Skip to main content

SharedObjectKind Interface

Defines a kind of shared object.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export interface SharedObjectKind<out TSharedObject = unknown> extends ErasedType<readonly ["SharedObjectKind", TSharedObject]>

Extends: ErasedType<readonly ["SharedObjectKind", TSharedObject]>

Type Parameters

Parameter Default Description
TSharedObject unknown

Remarks

Used in containers to register a shared object implementation, and to create new instances of a given type of shared object. See create(objectClass) and ContainerSchema for details.

Methods

Method Return Type Description
is(value) value is IFluidLoadable & TSharedObject Check whether an @fluidframework/core-interfaces#IFluidLoadable is an instance of this shared object kind.

Method Details

is

Check whether an @fluidframework/core-interfaces#IFluidLoadable is an instance of this shared object kind.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature
is(value: IFluidLoadable): value is IFluidLoadable & TSharedObject;
Remarks

This should be used in place of instanceof checks for shared objects, as their actual classes are not exported in Fluid's public API.

Parameters

Parameter Type Description
value IFluidLoadable

Returns

Return type: value is IFluidLoadable & TSharedObject