UNPKG

wam-extensions

Version:

Unofficial extensions to the Web Audio Module 2 API

26 lines (25 loc) 867 B
export declare type CollaborationOperation = { operation: "INSERT" | "DELETE"; position: number; length?: number; text?: string; }; export declare type RemoteSelection = { anchor: number; head: number; color: string; username: string; userId: string; }; export interface CollaborationDocumentInterface { toString(): string; onUpdate(callback?: (operations: CollaborationOperation[]) => void): void; insert(position: number, text: string): void; delete(index: number, length: number): void; applyOperations(operations: CollaborationOperation[]): void; updateSelection(anchor: number, head: number): void; selections(): RemoteSelection[]; } export declare class CollaborationExtension { getDocument?: (pluginId: string, documentId: string, initialContent: string) => CollaborationDocumentInterface; }