Skip to content

Instantly share code, notes, and snippets.

@sccolbert
Last active May 23, 2016 16:35
Show Gist options
  • Save sccolbert/1bc65007bac285a5ad54a357d2939b6b to your computer and use it in GitHub Desktop.
Save sccolbert/1bc65007bac285a5ad54a357d2939b6b to your computer and use it in GitHub Desktop.
interface ICommandRegistry {
commandAdded: ISignal<ICommandRegistry, string>;
commandRemoved: ISignal<ICommandRegistry, string>;
commandChanged: ISignal<ICommandRegistry, string>;
keyboardLayoutChanged: ISignal<ICommandRegistry, void>;
keyBindingsChanged: ISignal<ICommandRegistry, void>;
keyboardLayout: IKeyboardLayout;
listCommands(): string[];
listKeyBindings(): IKeyBinding[];
hasCommand(id: string): boolean;
addCommand(id: string, cmd: ICommand): ICommandHandle;
addKeyBindings(bindings: IKeyBinding[]): IDisposable;
label(id: string, args: any): string;
icon(id: string, args: any): string;
caption(id: string, args: any): string;
shortcut(id: string, args: any): string; // TODO - rules for resolving this?
category(id: string, args: any): string;
className(id: string, args: any): string;
isEnabled(id: string, args: any): boolean;
isToggled(id: string, args: any): boolean;
isVisible(id: string, args: any): boolean;
execute(id: string, args: any): Promise<any>;
processKeydownEvent(event: KeyboardEvent): void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment