2022-04-01 15:07:08 +00:00
|
|
|
import { syscall } from "./syscall";
|
2022-04-21 11:57:45 +00:00
|
|
|
import { PageMeta } from "../silverbullet-common/types";
|
2022-04-01 15:07:08 +00:00
|
|
|
|
|
|
|
export async function listPages(): Promise<PageMeta[]> {
|
|
|
|
return syscall("space.listPages");
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function readPage(
|
|
|
|
name: string
|
|
|
|
): Promise<{ text: string; meta: PageMeta }> {
|
|
|
|
return syscall("space.readPage", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function writePage(name: string, text: string): Promise<PageMeta> {
|
|
|
|
return syscall("space.writePage", name, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function deletePage(name: string): Promise<PageMeta> {
|
|
|
|
return syscall("space.deletePage", name);
|
|
|
|
}
|