Skip to main content
Version: v2

IContainerContext Interface

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​

PropertyAlertsModifiersTypeDescription
attachStateBetareadonlyAttachStateIndicates the attachment state of the container to a host service.
audienceBetareadonlyIAudience
baseSnapshotBetareadonlyISnapshotTree | undefined
clientDetailsBetareadonlyIClientDetails
clientIdBetareadonlystring | undefined
closeFnBetareadonly(error?: ICriticalContainerError) => voidInitiate closing of the container due to a critical error.
connectedBetareadonlyboolean
deltaManagerBetareadonlyIDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
disposeFnBetaoptional, readonly(error?: ICriticalContainerError) => voidInitiate disposing of the container due to a critical error.
getConnectionStateBetaoptional, readonly() => ConnectionStateGets the current connection state of the container.
idDeprecated, BetareadonlystringWARNING: 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.
loaderBetareadonlyILoader
optionsBetareadonlyRecord<string | number, any>Not recommended for general use, is used in some cases to control various runtime behaviors.
pendingLocalStateBetaoptionalunknown
quorumBetareadonlyIQuorumClients
scopeBetareadonlyFluidObjectAmbient services provided with the context
signalAudienceSystemoptional, readonlyIAudienceSignal-based audience provides a view of the audience that only relies on system signals which will be updated more quickly than IContainerContext#audience that relies on ops for write clients. Being signal-based the write members are inherently less reliable than IContainerContext#audience.
snapshotWithContentsBetaoptional, readonlyISnapshotThis contains all parts of a snapshot like blobContents, ops etc.
storageBetareadonlyIContainerStorageService
submitBatchFnBetareadonly(batch: IBatchMessage[], referenceSequenceNumber?: number) => number
submitFnDeprecated, Betareadonly(type: MessageType, contents: any, batch: boolean, appData?: any) => number
submitSignalFnBetareadonly(contents: unknown, targetClientId?: string) => void
submitSummaryFnBetareadonly(summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number
supportedFeaturesDeprecated, Betaoptional, readonlyReadonlyMap<string, unknown>
taggedLoggerBetareadonlyITelemetryBaseLogger

Methods​

MethodAlertsModifiersReturn TypeDescription
getAbsoluteUrl(relativeUrl)BetaoptionalPromise<string | undefined>Get an absolute url for a provided container-relative request.
getLoadedFromVersion()BetaIVersion | undefined
updateDirtyContainerState(dirty)Betavoid

Property Details​

attachState​

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

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

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

Signature​

readonly attachState: AttachState;

Type: AttachState

audience​

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

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

Signature​

readonly audience: IAudience;

Type: IAudience

baseSnapshot​

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

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

Signature​

readonly baseSnapshot: ISnapshotTree | undefined;

Type: ISnapshotTree | undefined

clientDetails​

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

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

Signature​

readonly clientDetails: IClientDetails;

Type: IClientDetails

clientId​

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

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

Signature​

readonly clientId: string | undefined;

Type: string | undefined

closeFn​

Initiate closing of the container due to a critical error.

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

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

Signature​

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

Type: (error?: ICriticalContainerError) => void

Remarks​

This is only one of many ways which the container might get closed. To enable the runtime to respond to close from any source, it exposes close().

connected​

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

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

Signature​

readonly connected: boolean;

Type: boolean

deltaManager​

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

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

Signature​

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

Type: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>

disposeFn​

Initiate disposing of the container due to a critical error.

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

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

Signature​

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

Type: (error?: ICriticalContainerError) => void

Remarks​

This is only one of many ways which the container might get disposed. To enable the runtime to respond to disposed from any source, it exposes dispose(error).

getConnectionState​

Gets the current connection state of the container.

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

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

Signature​

readonly getConnectionState?: () => ConnectionState;

Type: () => ConnectionState

Remarks​

This provides more detailed connection state information beyond the simple boolean connected property. Available starting from version 2.52.0. Property is not present in older versions.

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 for existing users, but is not recommended for new users.

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

Signature​

readonly id: string;

Type: string

loader​

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

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 for existing users, but is not recommended for new users.

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 for existing users, but is not recommended for new users.

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

Signature​

pendingLocalState?: unknown;

Type: unknown

quorum​

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

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 for existing users, but is not recommended for new users.

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

Signature​

readonly scope: FluidObject;

Type: FluidObject

signalAudience​

Signal-based audience provides a view of the audience that only relies on system signals which will be updated more quickly than IContainerContext#audience that relies on ops for write clients. Being signal-based the write members are inherently less reliable than IContainerContext#audience.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

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

Signature​

readonly signalAudience?: IAudience;

Type: IAudience

snapshotWithContents​

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

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

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

Signature​

readonly snapshotWithContents?: ISnapshot;

Type: ISnapshot

storage​

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

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

Signature​

readonly storage: IContainerStorageService;

Type: IContainerStorageService

submitBatchFn​

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

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 for existing users, but is not recommended for new users.

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 for existing users, but is not recommended for new users.

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 for existing users, but is not recommended for new users.

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 deprecated and will be removed in a future release.

This has been deprecated. It was used internally and there is no replacement.

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

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 for existing users, but is not recommended for new users.

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 for existing users, but is not recommended for new users.

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

Signature​

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

Parameters​

ParameterTypeDescription
relativeUrlstring

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 for existing users, but is not recommended for new users.

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

Signature​

getLoadedFromVersion(): IVersion | undefined;

Returns​

Return type: IVersion | undefined

updateDirtyContainerState​

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

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

Signature​

updateDirtyContainerState(dirty: boolean): void;

Parameters​

ParameterTypeDescription
dirtyboolean