2024-07-30 23:33:33 +08:00
|
|
|
import type { SysCallMapping } from "../../lib/plugos/system.ts";
|
2023-07-14 22:56:20 +08:00
|
|
|
import type { Client } from "../client.ts";
|
2023-05-24 02:53:53 +08:00
|
|
|
|
2023-07-14 22:56:20 +08:00
|
|
|
export function syncSyscalls(editor: Client): SysCallMapping {
|
2023-05-24 02:53:53 +08:00
|
|
|
return {
|
|
|
|
"sync.isSyncing": (): Promise<boolean> => {
|
2023-07-14 19:44:30 +08:00
|
|
|
return editor.syncService.isSyncing();
|
2023-05-24 02:53:53 +08:00
|
|
|
},
|
|
|
|
"sync.hasInitialSyncCompleted": (): Promise<boolean> => {
|
2023-07-14 19:44:30 +08:00
|
|
|
return editor.syncService.hasInitialSyncCompleted();
|
2023-05-24 02:53:53 +08:00
|
|
|
},
|
2023-08-06 03:09:41 +08:00
|
|
|
"sync.scheduleFileSync": (_ctx, path: string): Promise<void> => {
|
|
|
|
return editor.syncService.scheduleFileSync(path);
|
|
|
|
},
|
2023-08-16 02:24:02 +08:00
|
|
|
"sync.scheduleSpaceSync": () => {
|
|
|
|
return editor.syncService.scheduleSpaceSync();
|
|
|
|
},
|
2023-05-24 02:53:53 +08:00
|
|
|
};
|
|
|
|
}
|