/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal"; import type { IdCreationRange } from "@fluidframework/id-compressor/internal"; import type { FluidDataStoreMessage, IAttachMessage, IEnvelope, InboundAttachMessage } from "@fluidframework/runtime-definitions/internal"; import type { IDataStoreAliasMessage } from "./dataStore.js"; import type { GarbageCollectionMessage } from "./gc/index.js"; import type { IChunkedOp } from "./opLifecycle/index.js"; import type { IDocumentSchemaChangeMessageIncoming, IDocumentSchemaChangeMessageOutgoing } from "./summary/index.js"; /** * @legacy @beta */ export declare enum ContainerMessageType { FluidDataStoreOp = "component", Attach = "attach", ChunkedOp = "chunkedOp", BlobAttach = "blobAttach", Rejoin = "rejoin", Alias = "alias", /** * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since * the last allocation op was sent. * See the {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/id-compressor/README.md|IdCompressor README} for more details. */ IdAllocation = "idAllocation", /** * An op that changes document schema */ DocumentSchemaChange = "schema", /** * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC * state across all clients. */ GC = "GC" } /** * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime. * Message type are differentiated via a `type` string and contain different contents depending on their type. * * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here. * This way stringified values can be compared. * * @internal */ export interface TypedContainerRuntimeMessage { /** * Type of the op, within the ContainerRuntime's domain */ type: TType; /** * Domain-specific contents, interpreted according to the type */ contents: TContents; } /** * @internal * @privateRemarks exported per ContainerRuntime export for testing purposes */ export type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage>; export type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage; /** * @internal * @privateRemarks exported per ContainerRuntime export for testing purposes */ export type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage; export type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage; export type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage; export type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage; /** * @internal * @privateRemarks exported per ContainerRuntime export for testing purposes */ export type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage; export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage; export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage; export type InboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage; export type OutboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage; /** * Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime. * @internal */ export interface UnknownContainerRuntimeMessage { /** * Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime. * This is useful for type narrowing but should never be used as an actual message type at runtime. * Actual value will not be "__unknown...", but the type `Exclude` is not supported. */ type: "__unknown_container_message_type__never_use_as_value__"; /** * Domain-specific contents, but not decipherable by an unknown op. */ contents: unknown; } /** * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime. */ export type InboundContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | InboundContainerRuntimeAttachMessage | ContainerRuntimeChunkedOpMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | InboundContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage; /** * A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime, eventually to be sent to the ordering service. * These are messages generated by the local runtime, before the outbox's op virtualization step. */ export type LocalContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | OutboundContainerRuntimeAttachMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | OutboundContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage; /** * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc * promoted up to the outer object */ export type InboundSequencedContainerRuntimeMessage = Omit & InboundContainerRuntimeMessage; //# sourceMappingURL=messageTypes.d.ts.map