IContainerContext Interface

Packages > @fluidframework/container-definitions > IContainerContext

IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the loader layer. It gets passed into the instantiateRuntime(context, existing) call.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-definitions/legacy.

For more information about our API support guarantees, see here .

Signature

export interface IContainerContext

Properties

Property Alerts Modifiers Type Description
attachState Alpha readonly AttachState Indicates the attachment state of the container to a host service.
audience Alpha readonly IAudience
baseSnapshot Alpha readonly ISnapshotTree | undefined
clientDetails Alpha readonly IClientDetails
clientId Alpha readonly string | undefined
closeFn Alpha readonly (error?: ICriticalContainerError) => void
connected Alpha readonly boolean
deltaManager Alpha readonly IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
disposeFn Alpha optional, readonly (error?: ICriticalContainerError) => void
id Deprecated, Alpha readonly string WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers and scenarios which can change in the future.
loader Alpha readonly ILoader
options Alpha readonly Record<string | number, any> Not recommended for general use, is used in some cases to control various runtime behaviors.
pendingLocalState Alpha optional unknown
quorum Alpha readonly IQuorumClients
scope Alpha readonly FluidObject Ambient services provided with the context
snapshotWithContents Alpha optional, readonly ISnapshot This contains all parts of a snapshot like blobContents, ops etc.
storage Alpha readonly IDocumentStorageService
submitBatchFn Alpha readonly (batch: IBatchMessage[], referenceSequenceNumber?: number) => number
submitFn Deprecated, Alpha readonly (type: MessageType, contents: any, batch: boolean, appData?: any) => number
submitSignalFn Alpha readonly (contents: unknown, targetClientId?: string) => void
submitSummaryFn Alpha readonly (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number
supportedFeatures Alpha optional, readonly ReadonlyMap<string, unknown>
taggedLogger Alpha readonly ITelemetryBaseLogger

Methods

Method Alerts Modifiers Return Type Description
getAbsoluteUrl(relativeUrl) Alpha optional Promise<string | undefined> Get an absolute url for a provided container-relative request.
getLoadedFromVersion() Alpha IVersion | undefined
updateDirtyContainerState(dirty) Alpha void

Property Details

attachState

Indicates the attachment state of the container to a host service.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly attachState: AttachState;

Type: AttachState

audience

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly audience: IAudience;

Type: IAudience

baseSnapshot

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly baseSnapshot: ISnapshotTree | undefined;

Type: ISnapshotTree | undefined

clientDetails

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly clientDetails: IClientDetails;

Type: IClientDetails

clientId

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly clientId: string | undefined;

Type: string | undefined

closeFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly closeFn: (error?: ICriticalContainerError) => void;

Type: (error?: ICriticalContainerError ) => void

connected

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly connected: boolean;

Type: boolean

deltaManager

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

Type: IDeltaManager <ISequencedDocumentMessage , IDocumentMessage >

disposeFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly disposeFn?: (error?: ICriticalContainerError) => void;

Type: (error?: ICriticalContainerError ) => void

id

WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers and scenarios which can change in the future.

This API is deprecated and will be removed in a future release.

2.0.0-internal.5.2.0 - The docId is already logged by the taggedLogger for telemetry purposes, so this is generally unnecessary for telemetry. If the id is needed for other purposes it should be passed to the consumer explicitly.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly id: string;

Type: string

loader

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly loader: ILoader;

Type: ILoader

options

Not recommended for general use, is used in some cases to control various runtime behaviors.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly options: Record<string | number, any>;

Type: Record<string | number, any>

Remarks

Used to be ILoaderOptions, this is staging for eventual removal.

pendingLocalState

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

pendingLocalState?: unknown;

Type: unknown

quorum

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly quorum: IQuorumClients;

Type: IQuorumClients

scope

Ambient services provided with the context

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly scope: FluidObject;

Type: FluidObject

snapshotWithContents

This contains all parts of a snapshot like blobContents, ops etc.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly snapshotWithContents?: ISnapshot;

Type: ISnapshot

storage

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly storage: IDocumentStorageService;

Type: IDocumentStorageService

submitBatchFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;

Type: (batch: IBatchMessage [], referenceSequenceNumber?: number) => number

submitFn

This API is deprecated and will be removed in a future release.

Please use submitBatchFn & submitSummaryFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;

Type: (type: MessageType , contents: any, batch: boolean, appData?: any) => number

submitSignalFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly submitSignalFn: (contents: unknown, targetClientId?: string) => void;

Type: (contents: unknown, targetClientId?: string) => void

submitSummaryFn

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number;

Type: (summaryOp: ISummaryContent , referenceSequenceNumber?: number) => number

supportedFeatures

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly supportedFeatures?: ReadonlyMap<string, unknown>;

Type: ReadonlyMap<string, unknown>

taggedLogger

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

readonly taggedLogger: ITelemetryBaseLogger;

Type: ITelemetryBaseLogger

Method Details

getAbsoluteUrl

Get an absolute url for a provided container-relative request.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;

Parameters

Parameter Type Description
relativeUrl string

A relative request within the container

TODO: Optional for backwards compatibility. Make non-optional in version 0.19

Returns

Return type: Promise<string | undefined>

getLoadedFromVersion

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

getLoadedFromVersion(): IVersion | undefined;

Returns

Return type: IVersion | undefined

updateDirtyContainerState

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here .

Signature

updateDirtyContainerState(dirty: boolean): void;

Parameters

Parameter Type Description
dirty boolean