import type { Id, Disposable, Emitter } from "@codesandbox/pitcher-common"; import type { RelativeWorkspacePath } from "../../types"; import type { IDocument } from "./IDocument"; export type Clients = Record; export interface IDidSaveEvent { savedHash: string; } export interface IWillClientJoinEvent { clientId: string; username: string; } export interface IDidClientJoinEvent { clientId: string; username: string; clients: Clients; } export interface IDidClientLeaveEvent { clientId: string; username: string; clients: Clients; } export interface IWillClientLeaveEvent { clientId: string; username: string; } export interface IDidContentChangeEvent { contentHash: string; newContent: string | Uint8Array; } export interface IFile extends Disposable { onDidSave: Emitter["event"]; onDidContentChange: Emitter["event"]; onWillClientJoin: Emitter["event"]; onDidClientJoin: Emitter["event"]; onWillClientLeave: Emitter["event"]; onDidClientLeave: Emitter["event"]; onDidMove: Emitter["event"]; id: Id; content: string | Uint8Array; isBinary: boolean; clients: Clients; savedHash: string; contentHash: string; document: IDocument | null; path: RelativeWorkspacePath; isDirty: boolean; updatePath(newPath: RelativeWorkspacePath): void; resync(): Promise; /** * Will get the current content of the document in Pitcher and reset the otClient to that state. * It returns the current contents which should be updated in the code editor */ resetFromServer(): Promise; /** * Will get the current content of the document in Pitcher, reset the otClient to that state and * apply the current editor contents as a diff operation on top */ resetFromClient(content: string): Promise; updateContent(newContent: string): void; save(write?: boolean): Promise; } //# sourceMappingURL=IFile.d.ts.map