1
0

Add getPageMeta syscall

This commit is contained in:
Zef Hemel 2022-08-08 13:33:20 +02:00
parent 3589aadbb3
commit 98ae47a0ba
3 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,12 @@ export async function listPages(unfiltered = false): Promise<PageMeta[]> {
return syscall("space.listPages", unfiltered);
}
export async function getPageMeta(
name: string
): Promise<{ text: string; meta: PageMeta }> {
return syscall("space.getPageMeta", name);
}
export async function readPage(
name: string
): Promise<{ text: string; meta: PageMeta }> {

View File

@ -13,6 +13,9 @@ export default (space: Space): SysCallMapping => {
): Promise<{ text: string; meta: PageMeta }> => {
return space.readPage(name);
},
"space.getPageMeta": async (ctx, name: string): Promise<PageMeta> => {
return space.getPageMeta(name);
},
"space.writePage": async (
ctx,
name: string,

View File

@ -13,6 +13,9 @@ export function spaceSyscalls(editor: Editor): SysCallMapping {
): Promise<{ text: string; meta: PageMeta }> => {
return await editor.space.readPage(name);
},
"space.getPageMeta": async (ctx, name: string): Promise<PageMeta> => {
return await editor.space.getPageMeta(name);
},
"space.writePage": async (
ctx,
name: string,