Packages > @fluidframework/fluid-static > ContainerSchema

ContainerSchema Interface

The ContainerSchema declares the Fluid objects that will be available in the container. It includes both the instances of objects that are initially available upon container creation, as well as the types of objects that may be dynamically created throughout the lifetime of the container.

Signature

export interface ContainerSchema

Properties

Property Modifiers Type Description
dynamicObjectTypes optional LoadableObjectClass<any>[]

Dynamic objects are Loadable objects that can be created after the initial Container creation.

Types defined in initialObjects will always be available and are not required to be provided here.

For best practice it's recommended to define all the dynamic types you create even if they are included via initialObjects.

initialObjects LoadableObjectClassRecord Defines loadable objects that will be created when the Container is first created. It uses the key as the id and the value as the loadable object to create.

Property Details

dynamicObjectTypes

Dynamic objects are Loadable objects that can be created after the initial Container creation.

Types defined in initialObjects will always be available and are not required to be provided here.

For best practice it’s recommended to define all the dynamic types you create even if they are included via initialObjects.

Signature

dynamicObjectTypes?: LoadableObjectClass<any>[];

Type: LoadableObjectClass <any>[]

initialObjects

Defines loadable objects that will be created when the Container is first created. It uses the key as the id and the value as the loadable object to create.

Signature

initialObjects: LoadableObjectClassRecord;

Type: LoadableObjectClassRecord

Example

In the example below two objects will be created when the Container is first created. One with id “map1” that will return a SharedMap and the other with id “pair1” that will return a KeyValueDataObject.

{
  map1: SharedMap,
  pair1: KeyValueDataObject,
}