FluidReadonlyMap Interface
Like TypeScript's built in ReadonlyMap type. Unlike the built in ReadonlyMap, this interface includes Symbol.toStringTag.
To use, import via fluid-framework/beta.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export interface FluidReadonlyMap<K, V>
Type Parameters
| Parameter | Description |
|---|---|
| K | |
| V |
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| [Symbol.toStringTag] | Beta | readonly | string | Symbol.toStringTag |
| size | Beta | readonly | number | The number of entries in the map. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| [Symbol.iterator]() | Beta | FluidIterableIterator<[K, V]> | Returns an iterable of entries in the map. |
| entries() | Beta | FluidIterableIterator<[K, V]> | Returns an iterable of key, value pairs for every entry in the map. |
| forEach(callbackfn, thisArg) | Beta | void | Executes the provided function once per each key/value pair in the map. |
| get(key) | Beta | V | undefined | Returns the value associated to the specified key, or undefined if there is none. |
| has(key) | Beta | boolean | Returns a boolean indicating whether an element with the specified key exists or not. |
| keys() | Beta | FluidIterableIterator<K> | Returns an iterable of keys in the map. |
| values() | Beta | FluidIterableIterator<V> | Returns an iterable of values in the map. |
Property Details
[Symbol.toStringTag]
For more information about our API support guarantees, see here.
Signature
readonly [Symbol.toStringTag]: string;
Type: string
size
The number of entries in the map.
For more information about our API support guarantees, see here.
Signature
readonly size: number;
Type: number
Method Details
[Symbol.iterator]
Returns an iterable of entries in the map.
For more information about our API support guarantees, see here.
Signature
[Symbol.iterator](): FluidIterableIterator<[K, V]>;
Returns
Return type: FluidIterableIterator<[K, V]>
entries
Returns an iterable of key, value pairs for every entry in the map.
For more information about our API support guarantees, see here.
Signature
entries(): FluidIterableIterator<[K, V]>;
Returns
Return type: FluidIterableIterator<[K, V]>
forEach
Executes the provided function once per each key/value pair in the map.
For more information about our API support guarantees, see here.
Signature
forEach(callbackfn: (value: V, key: K, map: FluidReadonlyMap<K, V>) => void, thisArg?: any): void;
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| callbackfn | (value: V, key: K, map: FluidReadonlyMap<K, V>) => void | ||
| thisArg | optional | any |
get
Returns the value associated to the specified key, or undefined if there is none.
For more information about our API support guarantees, see here.
Signature
get(key: K): V | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | K |
Returns
Return type: V | undefined
has
Returns a boolean indicating whether an element with the specified key exists or not.
For more information about our API support guarantees, see here.
Signature
has(key: K): boolean;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | K |
Returns
Return type: boolean
keys
Returns an iterable of keys in the map.
For more information about our API support guarantees, see here.
Signature
keys(): FluidIterableIterator<K>;
Returns
Return type: FluidIterableIterator<K>
values
Returns an iterable of values in the map.
For more information about our API support guarantees, see here.
Signature
values(): FluidIterableIterator<V>;
Returns
Return type: FluidIterableIterator<V>