import type { IDisposable } from "@codesandbox/pitcher-common"; import { ot } from "@codesandbox/pitcher-common"; import type { file } from "@codesandbox/pitcher-protocol"; import type { IIncomingOperationEvent, IOperationAckEvent, ISelectionEvent, IErrorEvent, ClientSelections, SyncState, IDocument, ISendOperationEvent } from "../../../interface/clients/IDocument"; import type { PitcherMessageHandler } from "../../PitcherMessageHandler"; import type { File } from "./File"; export declare class Document implements IDisposable, IDocument { private messageHandler; private onIncomingOperationEmitter; onIncomingOperation: import("@codesandbox/pitcher-common").Event; private onSendOperationEmitter; onSendOperation: import("@codesandbox/pitcher-common").Event; private onOperationAckEmitter; onOperationAck: import("@codesandbox/pitcher-common").Event; private onSelectionEmitter; onSelection: import("@codesandbox/pitcher-common").Event; private onErrorEmitter; onError: import("@codesandbox/pitcher-common").Event; private onResyncEmitter; onResync: import("@codesandbox/pitcher-common").Event; file: File; otClient: ot.Client; clientSelections: ClientSelections; syncState: SyncState; constructor(file: File, doc: file.IDocumentObject, messageHandler: PitcherMessageHandler); private createOTClient; /** * Resync is used when there is an internal issue with the OT Document, which means we can gracefully recover * changes made on the server with any pending/queued operations from the client */ resync(content: string, revision: number): void; /** * In extreme cases we want to be able to reset the otClient to the server state. We do this when the code editor * is not able to apply its operations to the OT Document or it has problems applying server operations to the code editor. There * is not good way to recover from this and it should really never happen. But if it does happen we can completely reset the OTClient with * the current server document and its revision */ reset(content: string, revision: number): void; sendDocumentAck(revision: number): Promise<{ revision: number; }>; sendDocumentOperation(operation: ot.TextOperation, revision: number): Promise<{ revision: number; }>; /** * Apply a text operation to the ot-client * * @param operation the operation to apply */ applyClient(operation: ot.TextOperation): void; sendSelection(selection: file.ISelection, reason?: file.SelectionsUpdateReason): Promise; dispose(): void; } //# sourceMappingURL=Document.d.ts.map