Rewrote some navigation stuff based on new parser

This commit is contained in:
Zef Hemel
2022-04-03 18:42:12 +02:00
parent 16bf0d866d
commit 07453d638b
21 changed files with 206 additions and 235 deletions
+11 -7
View File
@@ -1,22 +1,26 @@
import { PageMeta } from "../../common/types";
import { SysCallMapping } from "../../plugos/system";
import { Storage } from "../disk_storage";
import {PageMeta} from "../../common/types";
import {SysCallMapping} from "../../plugos/system";
import {Storage} from "../disk_storage";
export default (storage: Storage): SysCallMapping => {
return {
listPages: (ctx): Promise<PageMeta[]> => {
"space.listPages": (ctx): Promise<PageMeta[]> => {
return storage.listPages();
},
readPage: async (
"space.readPage": async (
ctx,
name: string
): Promise<{ text: string; meta: PageMeta }> => {
return storage.readPage(name);
},
writePage: async (ctx, name: string, text: string): Promise<PageMeta> => {
"space.writePage": async (
ctx,
name: string,
text: string
): Promise<PageMeta> => {
return storage.writePage(name, text);
},
deletePage: async (ctx, name: string) => {
"space.deletePage": async (ctx, name: string) => {
return storage.deletePage(name);
},
};