1
0
silverbullet/mobile/syscalls/clientStore.ts
Zef Hemel 0365673c41
Mobile app PoC (#281)
Initial checkin of mobile "native" app
2023-01-08 12:24:12 +01:00

15 lines
597 B
TypeScript

import { proxySyscalls } from "../../plugos/syscalls/transport.ts";
import { SysCallMapping } from "../../plugos/system.ts";
import { storeSyscalls } from "../../plugos/syscalls/store.sqlite.ts";
import { ISQLite } from "../../plugos/sqlite/sqlite_interface.ts";
export function clientStoreSyscalls(db: ISQLite): SysCallMapping {
const storeCalls = storeSyscalls(db, "localData");
return proxySyscalls(
["clientStore.get", "clientStore.set", "clientStore.delete"],
(ctx, name, ...args) => {
return storeCalls[name.replace("clientStore.", "store.")](ctx, ...args);
},
);
}