feat: add command supports

This commit is contained in:
Zihad 2025-05-05 20:22:11 +06:00
parent bdc6ce3541
commit ab00e2a50f
2 changed files with 14 additions and 0 deletions

View file

@ -186,6 +186,19 @@ export default class EasyKeepViewPlugin extends Plugin {
this.activateEasyKeepView();
});
// Register commands here
this.addCommand({
id: "open-easy-keep-view",
name: "Open Easy Keep View",
callback: () => this.activateEasyKeepView(),
});
this.addCommand({
id: "create-easy-keep-note",
name: "Create New Easy Keep Note",
callback: () => this.createNewNote(),
});
// Update database on file-open
this.registerEvent(this.app.workspace.on("file-open", async (file) => {
if (file) {

View file

@ -23,6 +23,7 @@ export const DEFAULT_SETTINGS: EasyKeepViewPluginSettings = {
openAsHomepage: false,
};
export class EasySettingTab extends PluginSettingTab {
plugin: EasyKeepViewPlugin;