Notes -> Nuggets

This commit is contained in:
Zef Hemel
2022-02-25 11:27:58 +01:00
parent 29cbb74508
commit 0527430626
29 changed files with 157 additions and 202 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
import { CommandDef } from "./plugins/types";
export type NoteMeta = {
export type NuggetMeta = {
name: string;
};
@@ -14,27 +14,27 @@ export type AppCommand = {
};
export type AppViewState = {
currentNote?: string;
currentNugget?: string;
isSaved: boolean;
showNoteNavigator: boolean;
showNuggetNavigator: boolean;
showCommandPalette: boolean;
allNotes: NoteMeta[];
allNuggets: NuggetMeta[];
commands: Map<string, AppCommand>;
};
export const initialViewState: AppViewState = {
isSaved: false,
showNoteNavigator: false,
showNuggetNavigator: false,
showCommandPalette: false,
allNotes: [],
allNuggets: [],
commands: new Map(),
};
export type Action =
| { type: "note-loaded"; name: string }
| { type: "note-saved" }
| { type: "note-updated" }
| { type: "notes-listed"; notes: NoteMeta[] }
| { type: "nugget-loaded"; name: string }
| { type: "nugget-saved" }
| { type: "nugget-updated" }
| { type: "nuggets-listed"; nuggets: NuggetMeta[] }
| { type: "start-navigate" }
| { type: "stop-navigate" }
| { type: "update-commands"; commands: Map<string, AppCommand> }