Code widget refactor
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import type { CodeWidgetContent } from "$sb/types.ts";
|
||||
import { syscall } from "./syscall.ts";
|
||||
|
||||
export function render(
|
||||
lang: string,
|
||||
body: string,
|
||||
pageName: string,
|
||||
): Promise<CodeWidgetContent> {
|
||||
return syscall("codeWidget.render", lang, body, pageName);
|
||||
}
|
||||
@@ -7,3 +7,4 @@ export * as sync from "./sync.ts";
|
||||
export * as debug from "./debug.ts";
|
||||
export * as language from "./language.ts";
|
||||
export * as handlebars from "./handlebars.ts";
|
||||
export * as codeWidget from "./code_widget.ts";
|
||||
|
||||
@@ -120,6 +120,7 @@ export type ObjectQuery = Omit<Query, "prefix">;
|
||||
// Code widget stuff
|
||||
export type CodeWidgetCallback = (
|
||||
bodyText: string,
|
||||
pageName: string,
|
||||
) => Promise<CodeWidgetContent>;
|
||||
|
||||
export type CodeWidgetContent = {
|
||||
|
||||
Reference in New Issue
Block a user