Dictionary<TKey, TValue>
Defined in: bcl/dictionary.mts:2
A dictionary of key-value pairs compatible with C# IDictionary<TKey, TValue>.
Type Parameters
TKey
TKey
TValue
TValue
Constructors
Constructor
new Dictionary<TKey, TValue>(entries?): Dictionary<TKey, TValue>;Defined in: bcl/dictionary.mts:5
Parameters
entries?
Iterable<[TKey, TValue], any, any>
Returns
Dictionary<TKey, TValue>
Properties
map
protected readonly map: Map<TKey, TValue>;Defined in: bcl/dictionary.mts:3
Accessors
count
Get Signature
get count(): number;Defined in: bcl/dictionary.mts:10
Number of key-value pairs in the dictionary.
Returns
number
Methods
[iterator]()
iterator: IterableIterator<[TKey, TValue]>;Defined in: bcl/dictionary.mts:55
Returns
IterableIterator<[TKey, TValue]>
add()
add(key, value): void;Defined in: bcl/dictionary.mts:15
Associates the specified value with the specified key.
Parameters
key
TKey
value
TValue
Returns
void
clear()
clear(): void;Defined in: bcl/dictionary.mts:31
Removes all key-value pairs from the dictionary.
Returns
void
containsKey()
containsKey(key): boolean;Defined in: bcl/dictionary.mts:20
Whether the dictionary contains the specified key.
Parameters
key
TKey
Returns
boolean
getAt()
getAt(key): TValue;Defined in: bcl/dictionary.mts:36
Returns the value associated with the specified key.
Parameters
key
TKey
Returns
TValue
getKeys()
getKeys(): TKey[];Defined in: bcl/dictionary.mts:46
Returns a fresh array with a snapshot of the current keys.
Returns
TKey[]
getValues()
getValues(): TValue[];Defined in: bcl/dictionary.mts:51
Returns a fresh array with a snapshot of the current values.
Returns
TValue[]
remove()
remove(key): boolean;Defined in: bcl/dictionary.mts:26
Removes the value with the specified key from the dictionary.
Parameters
key
TKey
Returns
boolean
true when the key was removed; false when it wasn't found.
setAt()
setAt(key, value): void;Defined in: bcl/dictionary.mts:41
Associates the specified value with the specified key.
Parameters
key
TKey
value
TValue
Returns
void