0.0.4-beta • Published 4 years ago

monaco-remote v0.0.4-beta

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

monaco-remote

Monaco Editor with remote collaboration.

NPM version Downloads

monaco-remote

demo graphic

Installation

yarn add monaco-remote

Using

Realtime messaging interface definition

interface IMessage {
  uid?: string;
  message: Uint8Array;
  timestamp?: number;
}

interface IMessageChannel {
  sendMessage(message: IMessage): Promise<void>;
  onReceiver(listener: (message: IMessage) => any): void;
  onMemberJoined(listener: (memberId: string) => any): void;
  onMemberLeft(listener: (memberId: string) => any): void;
}

Monaco editor content manager options

interface IEditorContentManagerOptions {
  editor: editor.IStandaloneCodeEditor;
  channel: IMessageChannel;
}
new EditorContentManager({ editor, channel })

License

MIT, see the LICENSE file for detail.