silverbullet/webapp/syscalls/indexer.ts

18 lines
458 B
TypeScript
Raw Normal View History

2022-04-04 00:12:16 +08:00
import {Space} from "../space";
import {SysCallMapping} from "../../plugos/system";
import {transportSyscalls} from "../../plugos/syscalls/transport";
2022-03-25 19:03:06 +08:00
2022-04-04 00:12:16 +08:00
export function indexerSyscalls(space: Space): SysCallMapping {
2022-03-25 19:03:06 +08:00
return transportSyscalls(
[
"scanPrefixForPage",
"scanPrefixGlobal",
"get",
"set",
"batchSet",
"delete",
],
(ctx, name, ...args) => space.remoteSyscall(ctx.plug, `index.${name}`, args)
2022-03-25 19:03:06 +08:00
);
}