2023-05-23 18:53:53 +00:00
|
|
|
import { SysCallMapping } from "../../plugos/system.ts";
|
2023-07-14 11:44:30 +00:00
|
|
|
import type { Editor } from "../editor.tsx";
|
2023-05-23 18:53:53 +00:00
|
|
|
|
2023-07-14 11:44:30 +00:00
|
|
|
export function syncSyscalls(editor: Editor): SysCallMapping {
|
2023-05-23 18:53:53 +00:00
|
|
|
return {
|
|
|
|
"sync.isSyncing": (): Promise<boolean> => {
|
2023-07-14 11:44:30 +00:00
|
|
|
return editor.syncService.isSyncing();
|
2023-05-23 18:53:53 +00:00
|
|
|
},
|
|
|
|
"sync.hasInitialSyncCompleted": (): Promise<boolean> => {
|
2023-07-14 11:44:30 +00:00
|
|
|
return editor.syncService.hasInitialSyncCompleted();
|
2023-05-23 18:53:53 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|