import { State } from '../reducer'; import BaseService from './BaseService'; declare type LabelFunction = () => string; declare type EnabledCondition = string; export interface CommandContext { state: State; dispatch: Function; } export interface CommandRuntime { execute(context: CommandContext, ...args: any[]): Promise; enabledCondition?: EnabledCondition; mapStateToTitle?(state: any): string; } export interface CommandDeclaration { name: string; label?: LabelFunction | string; description?: string; parentLabel?: LabelFunction | string; iconName?: string; tinymceIconName?: string; role?: string; } export interface Command { declaration: CommandDeclaration; runtime?: CommandRuntime; } interface ReduxStore { dispatch(action: any): void; getState(): any; } interface Utils { store: ReduxStore; } export declare const utils: Utils; interface CommandByNameOptions { mustExist?: boolean; runtimeMustBeRegistered?: boolean; } export interface SearchResult { commandName: string; title: string; } export default class CommandService extends BaseService { private static instance_; static instance(): CommandService; private commands_; private store_; private devMode_; initialize(store: any, devMode: boolean): void; on(eventName: string, callback: Function): void; off(eventName: string, callback: Function): void; searchCommands(query: string, returnAllWhenEmpty: boolean, excludeWithoutLabel?: boolean): SearchResult[]; commandNames(publicOnly?: boolean): string[]; commandByName(name: string, options?: CommandByNameOptions): Command; registerDeclaration(declaration: CommandDeclaration): void; registerRuntime(commandName: string, runtime: CommandRuntime): void; componentRegisterCommands(component: any, commands: any[]): void; componentUnregisterCommands(commands: any[]): void; unregisterRuntime(commandName: string): void; private createContext; execute(commandName: string, ...args: any[]): Promise; scheduleExecute(commandName: string, args: any): void; currentWhenClauseContext(): { markdownEditorVisible: boolean; richTextEditorVisible: boolean; markdownEditorPaneVisible: any; markdownViewerPaneVisible: any; modalDialogVisible: boolean; sideBarVisible: boolean; noteListHasNotes: boolean; notesAreBeingSaved: boolean; syncStarted: any; inConflictFolder: boolean; oneNoteSelected: boolean; someNotesSelected: boolean; multipleNotesSelected: boolean; noNotesSelected: boolean; historyhasBackwardNotes: boolean; historyhasForwardNotes: boolean; oneFolderSelected: boolean; noteIsTodo: boolean; noteTodoCompleted: boolean; noteIsMarkdown: boolean; noteIsHtml: boolean; }; isPublic(commandName: string): boolean; isEnabled(commandName: string, whenClauseContext?: any): boolean; title(commandName: string, state?: any): string; iconName(commandName: string, variant?: string): string; label(commandName: string, fullLabel?: boolean): string; description(commandName: string): string; exists(commandName: string): boolean; } export {};