IDocumentSchema Interface

Packages > @fluidframework/container-runtime > IDocumentSchema

Document schema information. Describes overall shape of document schema, including unknown (to this version) properties.

Used by runtime to make a call if it can understand document schema. If it can’t, it should not continue with document and immediately fail, preventing random (cryptic) failures down the road and potentially corrupting documents. For now this structure and appropriate interpretation / behavior is focused only on runtime features. In the future that could be interpolated to more areas, including DDSs used, and even possibly - application schema.

Runtime will ignore any properties at the root that it does not understand (i.e. IDocumentSchema.app), but will stop (and fail session) on any unknown properties within “runtime” sub-tree.

In most cases values preserved in the document will not dictate if such features should be enabled in a given session. I.e. if compression is mentioned in document schema, this means that runtime version that opens such document must know how to interpret such ops, but does not need to actually use compression itself. That said, some options could be sticky, i.e. influence feature selection for all runtimes opening a document. ID compression is one such example. Currently there is no mechanism to remove feature from this property bag, i.e. once compression was used, even if it’s disabled (through feature gate or code deployment), all existing documents that used compression will continue to fail if opened by clients who do not support compression.

For now we are limiting it to just plain properties, and only really simple types, but that can be changed in the future.

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

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

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

Signature

export interface IDocumentSchema

Properties

Property Alerts Type Description
refSeq Alpha number
runtime Alpha Record<string, DocumentSchemaValueType>
version Alpha number

Property Details

refSeq

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

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

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

Signature

refSeq: number;

Type: number

runtime

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

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

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

Signature

runtime: Record<string, DocumentSchemaValueType>;

Type: Record<string, DocumentSchemaValueType >

version

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

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

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

Signature

version: number;

Type: number