1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-11 23:17:19 +02:00
Files
joplin/packages/app-cli/app/utils/initializeCommandService.ts
2025-07-01 22:47:03 +01:00

15 lines
667 B
TypeScript

import CommandService from '@joplin/lib/services/CommandService';
import stateToWhenClauseContext from '@joplin/lib/services/commands/stateToWhenClauseContext';
import libCommands from '@joplin/lib/commands/index';
import { State } from '@joplin/lib/reducer';
import { Store } from 'redux';
export default function initializeCommandService(store: Store<State>, devMode: boolean) {
CommandService.instance().initialize(store, devMode, stateToWhenClauseContext);
for (const command of libCommands) {
CommandService.instance().registerDeclaration(command.declaration);
CommandService.instance().registerRuntime(command.declaration.name, command.runtime());
}
}