open-collaboration-protocol
Version:
Open Collaboration Protocol implementation, part of the Open Collaboration Tools project
46 lines • 2.12 kB
TypeScript
import * as types from './types.js';
import { BroadcastType, RequestType, NotificationType } from './messaging/messages.js';
export declare namespace Messages {
namespace Peer {
const Join: RequestType<[types.User], types.JoinResponse | undefined>;
const Info: NotificationType<[types.Peer]>;
const Init: NotificationType<[types.InitData]>;
}
namespace Room {
const Joined: BroadcastType<[types.Peer]>;
const Left: BroadcastType<[types.Peer]>;
const Leave: NotificationType<[]>;
const PermissionsUpdated: BroadcastType<[types.Permissions]>;
const Closed: BroadcastType<[]>;
}
namespace Editor {
const Open: NotificationType<[string]>;
const Close: BroadcastType<[string]>;
/** Propose changes bypassing the Awarness tracking. Should open a diff editor */
const ProposeChanges: BroadcastType<[string, types.TextDiffChange[]]>;
const CloseProposal: BroadcastType<[string]>;
}
namespace Sync {
const DataUpdate: BroadcastType<[types.Binary]>;
const DataNotify: NotificationType<[types.Binary]>;
const AwarenessUpdate: BroadcastType<[types.Binary]>;
const AwarenessQuery: BroadcastType<[]>;
const AwarenessNotify: NotificationType<[types.Binary]>;
}
namespace FileSystem {
const Stat: RequestType<[string], types.FileSystemStat>;
const Mkdir: RequestType<[string], undefined>;
const ReadFile: RequestType<[string], types.FileData>;
const WriteFile: RequestType<[string, types.FileData], undefined>;
const ReadDir: RequestType<[string], Record<string, types.FileType>>;
const Delete: RequestType<[string], undefined>;
const Rename: RequestType<[string, string], undefined>;
const Change: BroadcastType<[types.FileChangeEvent]>;
}
namespace Chat {
const ChatMessage: BroadcastType<[message: string]>;
const DirectChatMessage: NotificationType<[message: string]>;
const IsWriting: BroadcastType<[]>;
}
}
//# sourceMappingURL=messages.d.ts.map