@fluidframework/map Package

Packages > @fluidframework/map

The map library provides interfaces and implementing classes for map-like distributed data structures.

Remarks

The following distributed data structures are defined in this library:

Interfaces

Interface Alerts Description
IDirectory Interface describing actions on a directory.
IDirectoryClearOperation Operation indicating the directory should be cleared.
IDirectoryCreateSubDirectoryOperation Operation indicating a subdirectory should be created.
IDirectoryDataObject Defines the in-memory object structure to be used for the conversion to/from serialized.
IDirectoryDeleteOperation Operation indicating a key should be deleted from the directory.
IDirectoryDeleteSubDirectoryOperation Operation indicating a subdirectory should be deleted.
IDirectoryEvents Events emitted in response to changes to the directory data.
IDirectorySetOperation Operation indicating a value should be set for a key.
IDirectoryValueChanged Type of "valueChanged" event parameter for ISharedDirectory
ILocalValue A local value to be stored in a container type Distributed Data Store (DDS).
ISerializableValue DEPRECATED The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use ISerializableValue.type to understand whether they're storing a Plain JavaScript object, a SharedObject, or a value type.
ISerializedValue Serialized ISerializableValue counterpart.
ISharedDirectory Provides a hierarchical organization of map-like data structures as SubDirectories. The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax. SubDirectories can be retrieved for use as working directories.
ISharedDirectoryEvents Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself, and not on subdirectories.
ISharedMap

The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting and retrieving values that JavaScript developers are accustomed to with the Map built-in object. However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a @fluidframework/shared-object-base#SharedObjectHandle.

For more information, including example usages, see https://fluidframework.com/docs/data-structures/map/.

ISharedMapEvents Events emitted in response to changes to the map data.
IValueChanged Type of "valueChanged" event parameter.

Classes

Class Modifiers Description
DirectoryFactory sealed IChannelFactory for SharedDirectory.
LocalValueMaker Enables a container type DDS to produce and store local values with minimal awareness of how those objects are stored, serialized, and deserialized.
MapFactory sealed IChannelFactory for SharedMap.
SharedDirectory sealed Provides a hierarchical organization of map-like data structures as SubDirectories. The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax. SubDirectories can be retrieved for use as working directories.
SharedMap

The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting and retrieving values that JavaScript developers are accustomed to with the Map built-in object. However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a @fluidframework/shared-object-base#SharedObjectHandle.

For more information, including example usages, see https://fluidframework.com/docs/data-structures/map/.

Types

TypeAlias Description
IDirectoryKeyOperation An operation on a specific key within a directory
IDirectoryOperation Any operation on a directory
IDirectoryStorageOperation An operation on one or more of the keys within a directory
IDirectorySubDirectoryOperation An operation on the subdirectories within a directory

Type Details

IDirectoryKeyOperation

An operation on a specific key within a directory

Signature

export declare type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;

IDirectoryOperation

Any operation on a directory

Signature

export declare type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;

IDirectoryStorageOperation

An operation on one or more of the keys within a directory

Signature

export declare type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;

IDirectorySubDirectoryOperation

An operation on the subdirectories within a directory

Signature

export declare type IDirectorySubDirectoryOperation = IDirectoryCreateSubDirectoryOperation | IDirectoryDeleteSubDirectoryOperation;