/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { Lazy } from "@fluidframework/core-utils/internal"; import type { IChannel, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal"; import type { ISnapshotTree } from "@fluidframework/driver-definitions/internal"; import type { ITelemetryContext, IFluidDataStoreContext, IGarbageCollectionData, ISummarizeResult, IPendingMessagesState, IRuntimeMessageCollection, IRuntimeStorageService } from "@fluidframework/runtime-definitions/internal"; import { type TelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal"; import { type ChannelServiceEndpoints, type IChannelContext } from "./channelContext.js"; import type { ISharedObjectRegistry } from "./dataStoreRuntime.js"; /** * Channel context for a locally created channel */ export declare abstract class LocalChannelContextBase implements IChannelContext { protected readonly id: string; protected readonly runtime: IFluidDataStoreRuntime; protected readonly services: Lazy; private readonly channelP; private _channel?; private globallyVisible; /** * Tracks the messages for this channel that are sent while it's not loaded */ protected pendingMessagesState: IPendingMessagesState; constructor(id: string, runtime: IFluidDataStoreRuntime, services: Lazy, channelP: Promise, _channel?: IChannel | undefined); protected get isGloballyVisible(): boolean; getChannel(): Promise; get isLoaded(): boolean; setConnectionState(connected: boolean, clientId?: string): void; /** * Process messages for this channel context. The messages here are contiguous messages for this context in a batch. * @param messageCollection - The collection of messages to process. */ processMessages(messageCollection: IRuntimeMessageCollection): void; reSubmit(content: unknown, localOpMetadata: unknown, squash: boolean): void; rollback(content: unknown, localOpMetadata: unknown): void; abstract applyStashedOp(content: unknown): unknown; /** * Returns a summary at the current sequence number. * @param fullTree - true to bypass optimizations and force a full summary tree * @param trackState - This tells whether we should track state from this summary. * @param telemetryContext - summary data passed through the layers for telemetry purposes */ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise; /** * For crafting the DataStore attach op. Only to be called when the channel is loaded (if applicable). * * Synchronously generates the channel's attach summary to be joined with the same from the DataStore's other channels */ getAttachSummary(telemetryContext?: ITelemetryContext): ISummarizeResult; /** * For crafting the DataStore attach op. Only to be called when the channel is loaded (if applicable). * * Synchronously generates the channel's attach GC data (set of outbound routes in the initial state) * to be joined with the same from the DataStore's other channels */ getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData; makeVisible(): void; /** * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context. * Each node has a set of outbound routes to other GC nodes in the document. This should be called only after * the context has loaded. * @param fullGC - true to bypass optimizations and force full generation of GC data. */ getGCData(fullGC?: boolean): Promise; updateUsedRoutes(usedRoutes: string[]): void; } export declare class RehydratedLocalChannelContext extends LocalChannelContextBase { private readonly snapshotTree; private readonly dirtyFn; constructor(id: string, registry: ISharedObjectRegistry, runtime: IFluidDataStoreRuntime, dataStoreContext: IFluidDataStoreContext, storageService: IRuntimeStorageService, logger: TelemetryLoggerExt, submitFn: (content: unknown, localOpMetadata: unknown) => void, dirtyFn: (address: string) => void, snapshotTree: ISnapshotTree, extraBlob?: Map); applyStashedOp(content: unknown): unknown; private isSnapshotInOldFormatAndCollectBlobs; private sanitizeSnapshot; } export declare class LocalChannelContext extends LocalChannelContextBase { readonly channel: IChannel; private readonly dirtyFn; constructor(channel: IChannel, runtime: IFluidDataStoreRuntime, dataStoreContext: IFluidDataStoreContext, storageService: IRuntimeStorageService, logger: TelemetryLoggerExt, submitFn: (content: unknown, localOpMetadata: unknown) => void, dirtyFn: (address: string) => void); applyStashedOp(): void; } //# sourceMappingURL=localChannelContext.d.ts.map