Skip to main content

FluidMapLegacy Interface

Legacy map-like API that extends FluidMap, without the get and set methods supplied by legacy map interfaces.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/map/legacy.

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 FluidMapLegacy<K, V> extends Omit<FluidMap<K, V>, "get" | "set" | "forEach">

Extends: Omit<FluidMap<K, V>, "get" | "set" | "forEach">

Type Parameters

ParameterDescription
K
V

Methods

MethodAlertsReturn TypeDescription
clear()BetavoidRemoves all entries from the map.
delete(key)BetabooleanRemoves the specified element from the map by its key.
forEach(callbackfn, thisArg)BetavoidExecutes the provided function once per each key/value pair in the map.
forEach(callbackfn, thisArg)BetavoidExecutes the provided function once per each key/value pair in the map.

Method Details

clear

Removes all entries from the map.

This API is provided for existing users, but is not recommended for new users.

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

Signature

clear(): void;

delete

Removes the specified element from the map by its key.

This API is provided for existing users, but is not recommended for new users.

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

Signature

delete(key: K): boolean;

Parameters

ParameterTypeDescription
keyK

Returns

true if an element existed and has been removed, or false if the element does not exist.

Return type: boolean

forEach

Executes the provided function once per each key/value pair in the map.

This API is provided for existing users, but is not recommended for new users.

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

Signature

forEach(callbackfn: (value: V, key: K, map: FluidMap<K, V>) => void, thisArg?: any): void;

Parameters

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

forEach

Executes the provided function once per each key/value pair in the map.

This API is provided for existing users, but is not recommended for new users.

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

Signature

forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;

Parameters

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