Inline content refactor

This commit is contained in:
Zef Hemel
2026-01-12 17:19:23 +01:00
parent 4cd12c8ae7
commit fb3dd51bdb
12 changed files with 268 additions and 315 deletions
+8
View File
@@ -5,6 +5,7 @@ import type {
FileMeta,
PageMeta,
} from "../../plug-api/types/index.ts";
import type { Ref } from "@silverbulletmd/silverbullet/lib/ref";
/**
* Exposes the space with its pages, documents and plugs.
@@ -156,6 +157,13 @@ export function readFile(name: string): Promise<Uint8Array> {
return syscall("space.readFile", name);
}
/**
* Reads a reference (e.g. page#header or page@20) and returns it as a string
*/
export function readRef(ref: string | Ref): Promise<string> {
return syscall("space.readRef", ref);
}
/**
* Read a file from the space returning both its data and meta data
* @param name the name of the page to read