/* -------------------------------------------------------------------------------------------- * Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ /// declare module monaco.editor { export interface IStandaloneCodeEditor { readonly _commandService: monaco.services.StandaloneCommandService; } } declare module monaco.commands { export interface ICommandEvent { commandId: string; } export interface ICommandService { onWillExecuteCommand: monaco.IEvent; executeCommand(commandId: string, ...args: any[]): Promise; executeCommand(commandId: string, ...args: any[]): Promise; } export interface ICommandHandler { (accessor: monaco.instantiation.ServicesAccessor, ...args: any[]): void; } export interface ICommand { id: string, handler: ICommandHandler; } export type ICommandsMap = Map; export interface ICommandRegistry { registerCommand(id: string, command: ICommandHandler): IDisposable; registerCommand(command: ICommand): IDisposable; registerCommandAlias(oldId: string, newId: string): IDisposable; getCommand(id: string): ICommand | undefined; getCommands(): ICommandsMap; } } declare module monaco.instantiation { export interface ServiceIdentifier { (...args: any[]): void; type: T; } export interface ServicesAccessor { get(id: ServiceIdentifier, isOptional?: typeof optional): T; } export interface IInstantiationService { } export function optional(serviceIdentifier: ServiceIdentifier): (target: Function, key: string, index: number) => void; } declare module monaco.services { export class StandaloneCommandService implements monaco.commands.ICommandService { constructor(instantiationService: monaco.instantiation.IInstantiationService); onWillExecuteCommand: monaco.IEvent; executeCommand(commandId: string, ...args: any[]): Promise; executeCommand(commandId: string, ...args: any[]): Promise; } }