@fluidframework/map Package

Packages > @fluidframework/map

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


The following distributed data structures are defined in this package:


List of classes contained in this package or namespace
Class Description
DirectoryFactory The factory that defines the directory.
MapFactory The factory that defines the map.
MapKernel A SharedMap is a map-like distributed data structure.
SharedDirectory SharedDirectory 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.


List of interfaces contained in this package or namespace
Interface Description
IDirectory Interface describing actions on a directory.
IDirectoryDataObject Defines the in-memory object structure to be used for the conversion to/from serialized.
IDirectoryValueChanged Type of "valueChanged" event parameter for SharedDirectory
IMapClearOperation Operation indicating the map should be cleared.
IMapDataObjectSerializable Defines the in-memory object structure to be used for the conversion to/from serialized. Directly used in JSON.stringify, direct result from JSON.parse
IMapDeleteOperation Operation indicating a key should be deleted from the map.
IMapSetOperation Operation indicating a value should be set for a key.
IMapValueTypeOperation Describes an operation specific to a value type.
ISerializableValue 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 JS object, a SharedObject, or a value type. Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate) and ops (set). If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members that are ISerializedHandle (the serialized form of a handle). If type is a value type then it must be amongst the types registered via registerValueType or we won't know how to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent. If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a channel ID. This type is legacy and deprecated.
ISharedDirectory Interface describing a shared directory.
ISharedMap Shared map interface
IValueChanged Type of "valueChanged" event parameter.
IValueType Defines a value type that can be registered on a container type.
IValueTypeCreator Container types that are able to create value types as contained values.

Type Aliases

List of type aliases contained in this package or namespace
Type Alias Description
IMapKeyOperation Map key operations are one of several types.
IMapOperation Description of a map delta operation

Type Aliases


Map key operations are one of several types.


export declare type IMapKeyOperation = IMapValueTypeOperation | IMapSetOperation | IMapDeleteOperation;


Description of a map delta operation


export declare type IMapOperation = IMapKeyOperation | IMapClearOperation;