FS API encoding support

This commit is contained in:
Zef Hemel
2022-09-05 16:15:01 +02:00
parent 9415624b93
commit 0ed956feda
18 changed files with 190 additions and 88 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import { Editor } from "../editor";
import { SysCallMapping } from "@plugos/plugos/system";
import { AttachmentMeta, PageMeta } from "@silverbulletmd/common/types";
import { AttachmentData } from "@silverbulletmd/common/spaces/space_primitives";
export function spaceSyscalls(editor: Editor): SysCallMapping {
return {
@@ -39,8 +40,8 @@ export function spaceSyscalls(editor: Editor): SysCallMapping {
"space.readAttachment": async (
ctx,
name: string
): Promise<{ buffer: ArrayBuffer; meta: AttachmentMeta }> => {
return await editor.space.readAttachment(name);
): Promise<{ data: AttachmentData; meta: AttachmentMeta }> => {
return await editor.space.readAttachment(name, "dataurl");
},
"space.getAttachmentMeta": async (
ctx,