1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/packages/app-desktop/gui/MainScreen/commands/gotoAnything.ts

21 lines
595 B
TypeScript

import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
const PluginManager = require('@joplin/lib/services/PluginManager');
export const declaration: CommandDeclaration = {
name: 'gotoAnything',
};
export const runtime = (): CommandRuntime => {
return {
execute: async () => {
return new Promise((resolve: Function, reject: Function) => {
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
menuItem.userData = {
callback: { resolve, reject },
};
menuItem.click();
});
},
};
};