Massive restructure of plugin API

This commit is contained in:
Zef Hemel
2022-10-14 15:11:33 +02:00
parent 982623fc38
commit 7d28b53b75
70 changed files with 826 additions and 969 deletions
+4 -4
View File
@@ -14,8 +14,8 @@ export function spaceSyscalls(editor: Editor): SysCallMapping {
"space.readPage": async (
_ctx,
name: string,
): Promise<{ text: string; meta: PageMeta }> => {
return await editor.space.readPage(name);
): Promise<string> => {
return (await editor.space.readPage(name)).text;
},
"space.getPageMeta": async (_ctx, name: string): Promise<PageMeta> => {
return await editor.space.getPageMeta(name);
@@ -46,8 +46,8 @@ export function spaceSyscalls(editor: Editor): SysCallMapping {
"space.readAttachment": async (
_ctx,
name: string,
): Promise<{ data: FileData; meta: AttachmentMeta }> => {
return await editor.space.readAttachment(name, "dataurl");
): Promise<FileData> => {
return (await editor.space.readAttachment(name, "dataurl")).data;
},
"space.getAttachmentMeta": async (
_ctx,