Skip to main content

@fluidframework/shared-object-base Package

Interfaces

InterfaceAlertsModifiersDescription
IFluidSerializerLegacy
ISharedObjectLegacyBase interface for shared objects from which other interfaces extend.
ISharedObjectEventsLegacyEvents emitted by ISharedObject.
ISharedObjectKindLegacyDefines 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.
SharedObjectKindsealedDefines a kind of shared object.

Classes

ClassAlertsDescription
SharedObjectLegacyHelper for implementing ISharedObject with simplified, synchronous summarization and garbage collection.
SharedObjectCoreLegacyBase class from which all shared objects derive.

Functions

FunctionAlertsReturn TypeDescription
makeHandlesSerializable(value, serializer, bind)Legacyunknown

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)LegacyunknownGiven 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.)

This API is provided for existing users, but is not recommended for new users.

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

ParameterTypeDescription
valueunknown
serializerIFluidSerializer
bindIFluidHandleBind 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.

This API is provided for existing users, but is not recommended for new users.

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

ParameterTypeDescription
valueunknownThe 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: unknown