IFluidContainer Interface
Provides an entrypoint into the client side of collaborative Fluid data. Provides access to the data as well as status on the collaboration session.
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 IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents>
Extends: IEventProvider<IFluidContainerEvents>
Type Parameters
| Parameter | Constraint | Default | Description |
|---|---|---|---|
| TContainerSchema | ContainerSchema | ContainerSchema | Used to determine the type of 'initialObjects'. |
Remarks
Note: external implementations of this interface are not supported.
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| attachState | readonly | AttachState | The current attachment state of the container. |
| connectionState | readonly | ConnectionState | Provides the current connected state of the container |
| disposed | readonly | boolean | Whether or not the container is disposed, which permanently disables it. |
| initialObjects | readonly | InitialObjects<TContainerSchema> | The collection of data objects and Distributed Data Stores (DDSes) that were specified by the schema. |
| isDirty | readonly | boolean | A container is considered **dirty** if it has local changes that have not yet been acknowledged by the service. |
Methods
| Method | Return Type | Description |
|---|---|---|
| attach(props) | Promise<string> | A newly created container starts detached from the collaborative service. Calling attach() uploads the new container to the service and connects to the collaborative service. |
| connect() | void | Attempts to connect the container to the delta stream and process operations. |
| create(objectClass) | Promise<T> | Create a new data object or Distributed Data Store (DDS) of the specified type. |
| disconnect() | void | Disconnects the container from the delta stream and stops processing operations. |
| dispose() | void | Dispose of the container instance, permanently disabling it. |
Property Details
attachState
The current attachment state of the container.
Signature
readonly attachState: AttachState;
Type: AttachState
Remarks
Once a container has been attached, it remains attached. When loading an existing container, it will already be attached.
connectionState
Provides the current connected state of the container
Signature
readonly connectionState: ConnectionState;
Type: ConnectionState
disposed
Whether or not the container is disposed, which permanently disables it.
Signature
readonly disposed: boolean;
Type: boolean
initialObjects
The collection of data objects and Distributed Data Stores (DDSes) that were specified by the schema.
Signature
readonly initialObjects: InitialObjects<TContainerSchema>;
Type: InitialObjects<TContainerSchema>
Remarks
These data objects and DDSes exist for the lifetime of the container.