Initial search implementation

This commit is contained in:
Zef Hemel
2022-05-16 15:09:36 +02:00
parent 7d01f77318
commit 2cdd3df6c3
17 changed files with 14798 additions and 62 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
import { AppCommand } from "./hooks/command";
import { AppCommand, CommandDef } from "./hooks/command";
import { FilterOption, PageMeta } from "@silverbulletmd/common/types";
export const slashCommandRegexp = /\/[\w\-]*/;
@@ -34,6 +34,7 @@ export type AppViewState = {
commands: Map<string, AppCommand>;
notifications: Notification[];
actionButtons: ActionButton[];
recentCommands: Map<string, Date>;
showFilterBox: boolean;
filterBoxLabel: string;
@@ -55,6 +56,7 @@ export const initialViewState: AppViewState = {
bhsHTML: "",
allPages: new Set(),
commands: new Map(),
recentCommands: new Map(),
notifications: [],
actionButtons: [],
showFilterBox: false,
@@ -87,6 +89,7 @@ export type Action =
| { type: "hide-lhs" }
| { type: "show-bhs"; html: string; flex: number; script?: string }
| { type: "hide-bhs" }
| { type: "command-run"; command: string }
| {
type: "show-filterbox";
options: FilterOption[];