Fix strict function type error for registerLanguageCommand

#81574
This commit is contained in:
Matt Bierner
2019-09-27 17:14:13 -07:00
parent 3dc33a7901
commit 42b59f5017

View File

@@ -241,7 +241,7 @@ export abstract class EditorAction extends EditorCommand {
// --- Registration of commands and actions
export function registerLanguageCommand(id: string, handler: (accessor: ServicesAccessor, args: { [n: string]: any }) => any) {
export function registerLanguageCommand<Args extends { [n: string]: any }>(id: string, handler: (accessor: ServicesAccessor, args: Args) => any) {
CommandsRegistry.registerCommand(id, (accessor, args) => handler(accessor, args || {}));
}