@fluidframework/shared-object-base Package
Interfaces
Interface | Alerts | Modifiers | Description |
---|---|---|---|
IFluidSerializer | Legacy , Alpha |
||
ISharedObject | Legacy , Alpha |
Base interface for shared objects from which other interfaces derive. Implemented by SharedObject |
|
ISharedObjectEvents | Legacy , Alpha |
Events emitted by ISharedObject. |
|
ISharedObjectKind | Legacy , Alpha |
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. | |
SharedObjectKind | sealed |
Defines a kind of shared object. |
Classes
Class | Alerts | Description |
---|---|---|
SharedObject | Legacy , Alpha |
SharedObject with simplified, synchronous summarization and GC. DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead. |
SharedObjectCore | Legacy , Alpha |
Base class from which all shared objects derive. |
Functions
Function | Alerts | Return Type | Description |
---|---|---|---|
makeHandlesSerializable(value, serializer, bind) | Legacy , Alpha |
any |
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 , Alpha |
any | Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object with handle objects created instead. |
Function Details
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: any, serializer: IFluidSerializer, bind: IFluidHandle): any;
Parameters
Parameter | Type | Description |
---|---|---|
value | any | |
serializer | IFluidSerializer | |
bind | IFluidHandle | Bind any other handles we find in the object against this given handle. |
Returns
The fully-plain object
Return type: any
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: any, serializer: IFluidSerializer): any;
Remarks
Idempotent when called multiple times.
Parameters
Parameter | Type | Description |
---|---|---|
value | any | 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: any