Skip to content 

@fluidframework/map Package

Packages > @fluidframework/map

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

Remarks

The following distributed data structures are defined in this package:

Classes

List of classes contained in this package or namespace
Class Description
Counter
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.

Interfaces

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.
IDirectoryNewStorageFormat
IDirectoryValueChanged Type of "valueChanged" event parameter for SharedDirectory
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
IMapDataObjectSerialized
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.
ISerializedValue
ISharedDirectory Interface describing a shared directory.
ISharedDirectoryEvents
ISharedMap Shared map interface
ISharedMapEvents
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.