@fluidframework/shared-object-base Package
Packages > @fluidframework/shared-object-base
Classes
Class | Description |
---|---|
SharedObject | Base class from which all shared objects derive |
Enumerations
Enumeration | Description |
---|---|
ValueType | enum representing the possible types of a shared object |
Functions
Function | Description |
---|---|
makeHandlesSerializable(value, serializer, context, bind) | 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, context) | 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, context, bind) | 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. |
Interfaces
Interface | Description |
---|---|
IProvideSharedObject | |
ISharedObject | Base interface for shared objects from which other interfaces derive. Implemented by SharedObject |
ISharedObjectEvents |
Variables
Variable | Description |
---|---|
ISharedObject |
Enumerations
ValueType enum
enum representing the possible types of a shared object
Signature:
export declare enum ValueType
Enumeration Members
Member | Value | Description |
---|---|---|
Plain | 1 |
The value is a plain JavaScript object or handle. If a plain object, it may contain handles deeper within. |
Shared | 0 |
The value is a shared object |
Functions
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, context: IFluidHandleContext, bind: IFluidHandle): any;
Parameters
Parameter | Type | Description |
---|---|---|
value | any | |
serializer | IFluidSerializer | |
context | IFluidHandleContext | The handle context for the container |
bind | IFluidHandle | Bind any other handles we find in the object against this given handle. |
Returns:
any
The fully-plain object
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, context: IFluidHandleContext): 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 |
context | IFluidHandleContext | The handle context for the container |
Returns:
any
The mostly-plain object with handle objects within
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, context: IFluidHandleContext, 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 |
context | IFluidHandleContext | The handle context for the container |
bind | IFluidHandle | Bind any other handles we find in the object against this given handle. |
Returns:
string | undefined
Result of strigifying an object
Variables
ISharedObject
Signature:
ISharedObject: keyof IProvideSharedObject