@fluidframework/shared-object-base Package
Interfaces
| Interface | Alerts | Modifiers | Description |
|---|---|---|---|
| DataStoreContext | Alpha | sealed | Contextual information about a data store which is provided when instantiating or loading it. |
| DataStoreOptions | Alpha | Options which define how to construct a particular DataStoreKind. | |
| IFluidSerializer | Legacy | ||
| ISharedObject | Legacy | Base interface for shared objects from which other interfaces extend. | |
| ISharedObjectEvents | Legacy | Events emitted by ISharedObject. | |
| ISharedObjectKind | Legacy | Defines a kind of shared object. Used in containers to register a shared object implementation, and to create new instances of a given type of shared object. | |
| SharedObjectCreator | Alpha | sealed | Creates instances of SharedObjectKinds. |
| SharedObjectKind | sealed | Defines a kind of shared object. | |
| SharedObjectKindAlpha | Alpha | sealed | A SharedObjectKind that also implements SharedObjectKey. |
Classes
| Class | Alerts | Description |
|---|---|---|
| SharedObject | Legacy | Helper for implementing ISharedObject with simplified, synchronous summarization and garbage collection. |
| SharedObjectCore | Legacy | Base class from which all shared objects derive. |
Types
| TypeAlias | Alerts | Description |
|---|---|---|
| SharedObjectKey | Alpha | A RegistryKey for a SharedObjectKind. |
| SharedObjectRegistry | Alpha | A Registry of shared object kinds that can be created or loaded within a data store. |
Functions
| Function | Alerts | Return Type | Description |
|---|---|---|---|
| defineDataStore(options) | Alpha | DataStoreKind<T> | Creates a DataStoreKind from DataStoreOptions. |
| makeHandlesSerializable(value, serializer, bind) | Legacy | unknown | Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object where any embedded IFluidHandles have been replaced with a serializable form. The original |
| parseHandles(value, serializer) | Legacy | unknown | Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object with handle objects created instead. |
| sharedObjectRegistryFromIterable(entries) | Alpha | SharedObjectRegistry | Creates a SharedObjectRegistry from an iterable of SharedObjectKindAlphas or async getters for them. |
Function Details
defineDataStore
Creates a DataStoreKind from DataStoreOptions.
To use, import via @fluidframework/shared-object-base/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function defineDataStore<T, TRoot extends IFluidLoadable>(options: DataStoreOptions<TRoot, T>): DataStoreKind<T>;
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| T | ||
| TRoot | IFluidLoadable |
Parameters
| Parameter | Type | Description |
|---|---|---|
| options | DataStoreOptions<TRoot, T> |
Returns
Return type: DataStoreKind<T>
makeHandlesSerializable
Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object where any embedded IFluidHandles have been replaced with a serializable form.
The original input object is not mutated. This method will shallowly clones all objects in the path from the root to any replaced handles. (If no handles are found, returns the original object.)
To use, import via @fluidframework/shared-object-base/legacy.
For more information about our API support guarantees, see here.
Signature
export declare function makeHandlesSerializable(value: unknown, serializer: IFluidSerializer, bind: IFluidHandle): unknown;
Parameters
| Parameter | Type | Description |
|---|---|---|
| value | unknown | |
| serializer | IFluidSerializer | |
| bind | IFluidHandle | Bind any other handles we find in the object against this given handle. |
Returns
The fully-plain object
Return type: unknown
parseHandles
Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object with handle objects created instead.
To use, import via @fluidframework/shared-object-base/legacy.
For more information about our API support guarantees, see here.
Signature
export declare function parseHandles(value: unknown, serializer: IFluidSerializer): unknown;
Remarks
Idempotent when called multiple times.
Parameters
| Parameter | Type | Description |
|---|---|---|
| value | unknown | The fully-plain object |
| serializer | IFluidSerializer | The serializer that knows how to convert serializable-form handles into handle objects |
Returns
The mostly-plain object with handle objects within
Return type: unknown
sharedObjectRegistryFromIterable
Creates a SharedObjectRegistry from an iterable of SharedObjectKindAlphas or async getters for them.
To use, import via @fluidframework/shared-object-base/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function sharedObjectRegistryFromIterable(entries: Iterable<SharedObjectKindAlpha<IFluidLoadable> | {
type: string;
kind: () => Promise<SharedObjectKindAlpha<IFluidLoadable>>;
}>): SharedObjectRegistry;
Parameters
| Parameter | Type | Description |
|---|---|---|
| entries | Iterable<SharedObjectKindAlpha<IFluidLoadable> | { type: string; kind: () => Promise<SharedObjectKindAlpha<IFluidLoadable>>; }> |
Returns
Return type: SharedObjectRegistry