# ProxyMap Class

Module
import { ProxyMap } from "@tsed/core"
Source/packages/core/src/class/ProxyMap.ts

# Overview

abstract class ProxyMap<T, I> implements Map<T, I> {
    protected registry: Map<T, I>;
<span class="token keyword">readonly</span> <span class="token punctuation">[</span>Symbol.toStringTag<span class="token punctuation">]</span><span class="token punctuation">:</span> <span class="token string">"Map"</span><span class="token punctuation">;</span>
<span class="token keyword">constructor</span><span class="token punctuation">(</span>registry<span class="token punctuation">:</span> Map&lt;T<span class="token punctuation">,</span> I&gt;<span class="token punctuation">,</span> mapSettings?<span class="token punctuation">:</span> <a href="/api/core/class/ProxyMapSettings.html"><span class="token">ProxyMapSettings</span></a><span class="token punctuation">)</span><span class="token punctuation">;</span>
/**
 *
 * @returns <span class="token punctuation">{</span>IterableIterator&lt;<span class="token punctuation">[</span>T <span class="token punctuation">,</span> I<span class="token punctuation">]</span>&gt;<span class="token punctuation">}</span>
 */
<span class="token punctuation">[</span>Symbol.iterator<span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> IterableIterator&lt;<span class="token punctuation">[</span>T<span class="token punctuation">,</span> I<span class="token punctuation">]</span>&gt;<span class="token punctuation">;</span>
/**
 * The <span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method removes all elements <span class="token keyword">from</span> a Map object.
 */
<span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
/**
 * The <span class="token function">delete</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method removes the specified element <span class="token keyword">from</span> a Map object.
 * @param key <a href="/api/common/mvc/decorators/Required.html"><span class="token">Required</span></a>. The key of the element to remove <span class="token keyword">from</span> the Map object.
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span> <a href="/api/swagger/decorators/Returns.html"><span class="token">Returns</span></a> true if an element in the Map object existed and has been removed<span class="token punctuation">,</span> or false if the element does not exist.
 */
<span class="token function">delete</span><span class="token punctuation">(</span>key<span class="token punctuation">:</span> T<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
/**
 * The <span class="token function">entries</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a new Iterator object that contains the <span class="token punctuation">[</span>key<span class="token punctuation">,</span> value<span class="token punctuation">]</span> pairs for each element in the Map object in insertion order.
 * @returns <span class="token punctuation">{</span>IterableIterator<span class="token punctuation">}</span> A new Map iterator object.
 */
<span class="token function">entries</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> IterableIterator&lt;<span class="token punctuation">[</span>T<span class="token punctuation">,</span> I<span class="token punctuation">]</span>&gt;<span class="token punctuation">;</span>
/**
 * The <span class="token function">keys</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a new Iterator object that contains the keys for each element in the Map object in insertion order.
 * @returns <span class="token punctuation">{</span>IterableIterator<span class="token punctuation">}</span> A new Map iterator object.
 */
<span class="token function">keys</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> IterableIterator&lt;T&gt;<span class="token punctuation">;</span>
/**
 * The <span class="token function">values</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a new Iterator object that contains the values for each element in the Map object in insertion order.
 * @returns <span class="token punctuation">{</span>IterableIterator<span class="token punctuation">}</span> A new Map iterator object.
 */
<span class="token function">values</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> IterableIterator&lt;I&gt;<span class="token punctuation">;</span>
/**
 * The <span class="token function">forEach</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method executes a provided function once per each key/value pair in the Map object<span class="token punctuation">,</span> in insertion order.
 *
 * @param callbackfn Function to execute for each element.
 * @param thisArg <a href="/api/di/decorators/Value.html"><span class="token">Value</span></a> to use <span class="token keyword">as</span> this when executing callback.
 * @description
 * The forEach method executes the provided callback once for each key of the map which actually exist. It is not invoked for keys which have been deleted. However<span class="token punctuation">,</span> it is executed for values which are present but have the value undefined.
 * callback is invoked with three arguments<span class="token punctuation">:</span>
 *
 * * the element value
 * * the element key
 * * the Map object being traversed
 *
 * If a thisArg parameter is provided to forEach<span class="token punctuation">,</span> it will be passed to callback when invoked<span class="token punctuation">,</span> for use <span class="token keyword">as</span> its this value.  Otherwise<span class="token punctuation">,</span> the value undefined will be passed for use <span class="token keyword">as</span> its this value.  The this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function.
 *
 * Each value is visited once<span class="token punctuation">,</span> except in the case when it was deleted and re-added before forEach has finished. callback is not invoked for values deleted before being visited. New values added before forEach has finished will be visited.
 * forEach executes the callback function once for each element in the Map object<span class="token punctuation">;</span> it does not return a value.
 *
 */
<span class="token function">forEach</span><span class="token punctuation">(</span>callbackfn<span class="token punctuation">:</span> <span class="token punctuation">(</span>value<span class="token punctuation">:</span> I<span class="token punctuation">,</span> key<span class="token punctuation">:</span> T<span class="token punctuation">,</span> map<span class="token punctuation">:</span> Map&lt;T<span class="token punctuation">,</span> I&gt;<span class="token punctuation">)</span> =&gt; <span class="token keyword">void</span><span class="token punctuation">,</span> thisArg?<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
/**
 * The <span class="token function">get</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a specified element <span class="token keyword">from</span> a Map object.
 * @param key <a href="/api/common/mvc/decorators/Required.html"><span class="token">Required</span></a>. The key of the element to return <span class="token keyword">from</span> the Map object.
 * @returns <span class="token punctuation">{</span>T<span class="token punctuation">}</span> <a href="/api/swagger/decorators/Returns.html"><span class="token">Returns</span></a> the element associated with the specified key or undefined if the key can't be found in the Map object.
 */
<span class="token function">get</span><span class="token punctuation">(</span>key<span class="token punctuation">:</span> T<span class="token punctuation">)</span><span class="token punctuation">:</span> I | undefined<span class="token punctuation">;</span>
/**
 * The <span class="token function">set</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method adds or updates an element with a specified key and value to a Map object.
 * @param key <a href="/api/common/mvc/decorators/Required.html"><span class="token">Required</span></a>. The key of the element to add to the Map object.
 * @param value <a href="/api/common/mvc/decorators/Required.html"><span class="token">Required</span></a>. The value of the element to add to the Map object.
 * @returns <span class="token punctuation">{</span><a href="/api/core/class/Registry.html"><span class="token">Registry</span></a><span class="token punctuation">}</span>
 */
<span class="token function">set</span><span class="token punctuation">(</span>key<span class="token punctuation">:</span> T<span class="token punctuation">,</span> value<span class="token punctuation">:</span> I<span class="token punctuation">)</span><span class="token punctuation">:</span> this<span class="token punctuation">;</span>
/**
 * The <span class="token function">has</span><span class="token punctuation">(</span><span class="token punctuation">)</span> method returns a <span class="token keyword">boolean</span> indicating whether an element with the specified key exists or not.
 * @param key
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span>
 */
<span class="token function">has</span><span class="token punctuation">(</span>key<span class="token punctuation">:</span> T<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
/**
 *
 * @returns <span class="token punctuation">{</span>Map&lt;<span class="token keyword">any</span><span class="token punctuation">,</span> <span class="token keyword">any</span>&gt;<span class="token punctuation">}</span>
 */

/**
 * Return the size of the map.
 * @returns <span class="token punctuation">{</span><span class="token keyword">number</span><span class="token punctuation">}</span>
 */
get <span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
/**
 *
 * @param value
 * @param query
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span>
 */

}