1
0
silverbullet/web/syscalls/collab.ts
2022-10-25 18:50:07 +02:00

21 lines
447 B
TypeScript

import { SysCallMapping } from "../../plugos/system.ts";
import type { Editor } from "../editor.tsx";
export function collabSyscalls(editor: Editor): SysCallMapping {
return {
"collab.start": (
_ctx,
serverUrl: string,
token: string,
username: string,
) => {
editor.startCollab(serverUrl, token, username);
},
"collab.stop": (
_ctx,
) => {
editor.collabState?.stop();
},
};
}