Skip to content 

@fluidframework/shared-object-base Package

Packages > @fluidframework/shared-object-base

Classes

List of classes contained in this package or namespace
Class Description
SharedObject Base class from which all shared objects derive

Enumerations

List of enums contained in this package or namespace
Enumeration Description
ValueType enum representing the possible types of a shared object

Functions

List of functions contained in this package or namespace
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

List of interfaces contained in this package or namespace
Interface Description
IProvideSharedObject
ISharedObject Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
ISharedObjectEvents

Variables

List of variables contained in this package or namespace
Variable Description
ISharedObject

Enumerations

ValueType enum

enum representing the possible types of a shared object

Signature:

export declare enum ValueType 

Enumeration Members

List of members in use in this enum
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

List of 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

List of 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

List of 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