1
0
silverbullet/plug-api/app_event.ts
Zef Hemel 3545d00d46
Major mini editor refactoring (#225)
Replaces most editing components with CM components, enabling vim mode and completions everywhere

Fixes #205 
Fixes #221 
Fixes #222 
Fixes #223
2022-12-21 14:55:24 +01:00

45 lines
726 B
TypeScript

import type { ParseTree } from "$sb/lib/tree.ts";
import { ParsedQuery } from "$sb/lib/query.ts";
export type AppEvent =
| "page:click"
| "editor:complete"
| "minieditor:complete"
| "page:load"
| "editor:init"
| "plugs:loaded";
export type QueryProviderEvent = {
query: ParsedQuery;
pageName: string;
};
export type ClickEvent = {
page: string;
pos: number;
metaKey: boolean;
ctrlKey: boolean;
altKey: boolean;
};
export type IndexEvent = {
name: string;
text: string;
};
export type IndexTreeEvent = {
name: string;
tree: ParseTree;
};
export type PublishEvent = {
uri: string;
// Page name
name: string;
};
export type CompleteEvent = {
linePrefix: string;
pos: number;
};