Skip to main content
Version: v1

@fluidframework/shared-object-base Package

Interfaces

InterfaceDescription
IFluidSerializer
ISerializedHandleJSON serialized form of an IFluidHandle
ISharedObjectBase interface for shared objects from which other interfaces derive. Implemented by SharedObject
ISharedObjectEvents

Classes

ClassDescription
FluidSerializerData Store serializer implementation
SharedObjectSharedObject with simplified, synchronous summarization and GC. DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
SharedObjectCoreBase class from which all shared objects derive
SummarySerializerSerializer implementation for serializing handles during summary.

Enumerations

EnumDescription
ValueTypeenum representing the possible types of a shared object

Functions

FunctionReturn TypeDescription
createSingleBlobSummary(key, content)ISummaryTreeWithStatsCreate 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 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.)

parseHandles(value, serializer)anyGiven 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 | undefinedGiven 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

VariableTypeDescription
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

ParameterTypeDescription
keystringthe key for the blob in the summary
contentstring | Uint8Arrayblob 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

ParameterTypeDescription
valueany
serializerIFluidSerializer
bindIFluidHandleBind 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

ParameterTypeDescription
valueanyThe fully-plain object
serializerIFluidSerializerThe 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

ParameterTypeDescription
valueanyThe mostly-plain object
serializerIFluidSerializerThe serializer that knows how to convert handles into serializable format
bindIFluidHandleBind 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