import * as awarenessProtocol from "y-protocols/awareness"; import { Doc } from "yjs"; import { Connection, Server, WSMessage } from "partyserver"; //#region src/server/index.d.ts type YjsRootType = | "Text" | "Map" | "Array" | "XmlText" | "XmlElement" | "XmlFragment"; declare class WSSharedDoc extends Doc { awareness: awarenessProtocol.Awareness; constructor(); } interface CallbackOptions { debounceWait?: number; debounceMaxWait?: number; timeout?: number; } type ServerClass = new (...args: any[]) => Server; interface YjsInstance { readonly document: WSSharedDoc; onLoad(): Promise; onSave(): Promise; unstable_replaceDocument( snapshotUpdate: Uint8Array, getMetadata?: (key: string) => YjsRootType ): void; isReadOnly(connection: Connection): boolean; onCustomMessage(connection: Connection, message: string): void; sendCustomMessage(connection: Connection, message: string): void; broadcastCustomMessage(message: string, excludeConnection?: Connection): void; handleMessage(connection: Connection, message: WSMessage): void; } interface YjsStatic { callbackOptions: CallbackOptions; } declare function withYjs( Base: TBase ): TBase & YjsStatic & (new (...args: any[]) => YjsInstance); declare const YServer: typeof Server & YjsStatic & (new (...args: any[]) => YjsInstance); //#endregion export { CallbackOptions, YServer, YjsInstance, YjsStatic, withYjs }; //# sourceMappingURL=index.d.cts.map