1
0
silverbullet/plug-api/app_event.ts

58 lines
966 B
TypeScript
Raw Normal View History

import type { ParseTree } from "$sb/lib/tree.ts";
import { ParsedQuery } from "$sb/lib/query.ts";
2022-07-11 07:08:22 +00:00
export type AppEvent =
| "page:click"
| "editor:complete"
| "minieditor:complete"
2022-07-11 07:08:22 +00:00
| "page:load"
| "editor:init"
2023-01-26 14:54:28 +00:00
| "editor:pageLoaded"
| "editor:pageReloaded"
| "editor:pageSaved"
2023-01-23 17:52:17 +00:00
| "editor:modeswitch"
2022-07-11 07:08:22 +00:00
| "plugs:loaded";
2022-10-14 13:11:33 +00:00
export type QueryProviderEvent = {
query: ParsedQuery;
pageName: string;
};
export type ClickEvent = {
2022-03-28 13:25:05 +00:00
page: string;
pos: number;
metaKey: boolean;
ctrlKey: boolean;
altKey: boolean;
};
export type IndexEvent = {
name: string;
text: string;
};
export type IndexTreeEvent = {
name: string;
tree: ParseTree;
};
2022-11-24 15:08:51 +00:00
export type PublishEvent = {
uri: string;
// Page name
name: string;
};
export type CompleteEvent = {
pageName: string;
linePrefix: string;
pos: number;
};
2023-01-21 12:37:55 +00:00
export type WidgetContent = {
html?: string;
script?: string;
url?: string;
height?: number;
width?: number;
};