@fluidframework/shared-object-base Package
Interfaces
Interface | Description |
---|---|
IFluidSerializer | |
ISerializedHandle | JSON serialized form of an IFluidHandle |
ISharedObject | Base interface for shared objects from which other interfaces derive. Implemented by SharedObject |
ISharedObjectEvents |
Classes
Class | Description |
---|---|
FluidSerializer | Data Store serializer implementation |
SharedObject | SharedObject with simplified, synchronous summarization and GC. DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead. |
SharedObjectCore | Base class from which all shared objects derive |
SummarySerializer | Serializer implementation for serializing handles during summary. |
Enumerations
Enum | Description |
---|---|
ValueType | enum representing the possible types of a shared object |
Functions
Function | Return Type | Description |
---|---|---|
createSingleBlobSummary(key, content) | ISummaryTreeWithStats | Create a new summary containing one blob |
makeHandlesSerializable(value, serializer, bind) | 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) | any | Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object with handle objects created instead. |
serializeHandles(value, serializer, bind) | string | undefined | Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object where the handle objects have been replaced with a serializable form. |
Variables
Variable | Type | Description |
---|---|---|
isSerializedHandle | (value: any) => value is ISerializedHandle |
Function Details
createSingleBlobSummary
Create a new summary containing one blob
Signature
export declare function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
Parameters
Parameter | Type | Description |
---|---|---|
key | string | the key for the blob in the summary |
content | string | Uint8Array | blob content |
Returns
The summary containing the blob
Return type: ISummaryTreeWithStats
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.)
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.
Signature
export declare function parseHandles(value: any, serializer: IFluidSerializer): any;
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
serializeHandles
Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object where the handle objects have been replaced with a serializable form.
Signature
export declare function serializeHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): string | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
value | any | The mostly-plain object |
serializer | IFluidSerializer | The serializer that knows how to convert handles into serializable format |
bind | IFluidHandle | Bind any other handles we find in the object against this given handle. |
Returns
Result of strigifying an object
Return type: string | undefined
Variable Details
isSerializedHandle
Signature
isSerializedHandle: (value: any) => value is ISerializedHandle
Type: (value: any) => value is ISerializedHandle