Skip to main content

FluidReadonlyMap Interface

Like TypeScript's built in ReadonlyMap type. Unlike the built in ReadonlyMap, this interface includes Symbol.toStringTag.

This API is provided as a beta preview and may change without notice.

To use, import via fluid-framework/beta.

For more information about our API support guarantees, see here.

Sealed

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

ParameterDescription
K
V

Properties

PropertyAlertsModifiersTypeDescription
[Symbol.toStringTag]BetareadonlystringSymbol.toStringTag
sizeBetareadonlynumberThe number of entries in the map.

Methods

MethodAlertsReturn TypeDescription
[Symbol.iterator]()BetaFluidIterableIterator<[K, V]>Returns an iterable of entries in the map.
entries()BetaFluidIterableIterator<[K, V]>Returns an iterable of key, value pairs for every entry in the map.
forEach(callbackfn, thisArg)BetavoidExecutes the provided function once per each key/value pair in the map.
get(key)BetaV | undefinedReturns the value associated to the specified key, or undefined if there is none.
has(key)BetabooleanReturns a boolean indicating whether an element with the specified key exists or not.
keys()BetaFluidIterableIterator<K>Returns an iterable of keys in the map.
values()BetaFluidIterableIterator<V>Returns an iterable of values in the map.

Property Details

[Symbol.toStringTag]

Symbol.toStringTag

This API is provided as a beta preview and may change without notice.

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.

This API is provided as a beta preview and may change without notice.

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.

This API is provided as a beta preview and may change without notice.

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.

This API is provided as a beta preview and may change without notice.

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.

This API is provided as a beta preview and may change without notice.

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

ParameterModifiersTypeDescription
callbackfn(value: V, key: K, map: FluidReadonlyMap<K, V>) => void
thisArgoptionalany

get

Returns the value associated to the specified key, or undefined if there is none.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

get(key: K): V | undefined;

Parameters

ParameterTypeDescription
keyK

Returns

Return type: V | undefined

has

Returns a boolean indicating whether an element with the specified key exists or not.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

has(key: K): boolean;

Parameters

ParameterTypeDescription
keyK

Returns

Return type: boolean

keys

Returns an iterable of keys in the map.

This API is provided as a beta preview and may change without notice.

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.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

values(): FluidIterableIterator<V>;

Returns

Return type: FluidIterableIterator<V>