silverbullet/plug-api/syscalls/code_widget.ts

16 lines
422 B
TypeScript
Raw Normal View History

2024-02-29 22:23:05 +08:00
import type { CodeWidgetContent } from "../types.ts";
import { syscall } from "../syscall.ts";
2023-10-31 17:33:38 +08:00
export function render(
lang: string,
body: string,
pageName: string,
): Promise<CodeWidgetContent | null> {
2023-10-31 17:33:38 +08:00
return syscall("codeWidget.render", lang, body, pageName);
}
2023-11-15 17:08:21 +08:00
// Refresh all code widgets on the page that support it
2024-07-30 23:24:17 +08:00
export function refreshAll(): Promise<void> {
2023-11-15 17:08:21 +08:00
return syscall("codeWidget.refreshAll");
}