2020-11-09 14:07:37 +02:00
|
|
|
import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
|
2020-07-03 23:32:39 +02:00
|
|
|
|
|
|
|
export const declaration:CommandDeclaration = {
|
|
|
|
name: 'search',
|
2020-09-15 15:01:07 +02:00
|
|
|
iconName: 'icon-search',
|
2020-07-03 23:32:39 +02:00
|
|
|
};
|
|
|
|
|
2020-11-09 14:07:37 +02:00
|
|
|
export const runtime = ():CommandRuntime => {
|
2020-07-03 23:32:39 +02:00
|
|
|
return {
|
2020-11-09 14:07:37 +02:00
|
|
|
execute: async () => {
|
|
|
|
// Doesn't do anything for now but could be used to
|
|
|
|
// automatically focus the search field (using the
|
|
|
|
// `focusSearch` command) and then set an initial search.
|
|
|
|
// However not straightforward to implement since the SearchBar
|
|
|
|
// is not a controlled component.
|
2020-07-03 23:32:39 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|