2020-07-03 23:32:39 +02:00
|
|
|
import CommandService, { CommandDeclaration, CommandRuntime } from '../../../lib/services/CommandService';
|
|
|
|
const { _ } = require('lib/locale');
|
|
|
|
|
|
|
|
export const declaration:CommandDeclaration = {
|
|
|
|
name: 'newTodo',
|
|
|
|
label: () => _('New to-do'),
|
|
|
|
iconName: 'fa-check-square',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const runtime = ():CommandRuntime => {
|
|
|
|
return {
|
|
|
|
execute: async ({ template }:any) => {
|
|
|
|
return CommandService.instance().execute('newNote', { template: template, isTodo: true });
|
|
|
|
},
|
|
|
|
isEnabled: () => {
|
|
|
|
return CommandService.instance().isEnabled('newNote');
|
|
|
|
},
|
2020-07-04 11:33:04 +02:00
|
|
|
title: () => {
|
|
|
|
return _('New to-do');
|
|
|
|
},
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
};
|