import { ICommandMetadata } from "../../../platform/commands/common/commands.js"; import * as extHostTypes from "./extHostTypes.js"; import * as extHostTypeConverter from "./extHostTypeConverters.js"; import { ExtHostCommandsShape, ICommandDto, ICommandMetadataDto } from "./extHost.protocol.js"; import * as languages from "../../../editor/common/languages.js"; import type * as vscode from "vscode"; import { ILogService } from "../../../platform/log/common/log.service.js"; import { IRange } from "../../../editor/common/core/range.js"; import { IPosition } from "../../../editor/common/core/position.js"; import { URI } from "../../../base/common/uri.js"; import { DisposableStore } from "../../../base/common/lifecycle.js"; import { IExtHostRpcService } from "./extHostRpcService.js"; import { ISelection } from "../../../editor/common/core/selection.js"; import { IExtensionDescription } from "../../../platform/extensions/common/extensions.js"; import { IExtHostTelemetry } from "./extHostTelemetry.js"; export interface ArgumentProcessor { processArgument(arg: any, extension: IExtensionDescription | undefined): any; } export declare class ExtHostCommands implements ExtHostCommandsShape { #private; readonly _serviceBrand: undefined; private readonly _commands; private readonly _apiCommands; private readonly _logService; private readonly _argumentProcessors; readonly converter: CommandsConverter; constructor(extHostRpc: IExtHostRpcService, logService: ILogService, extHostTelemetry: IExtHostTelemetry); registerArgumentProcessor(processor: ArgumentProcessor): void; registerApiCommand(apiCommand: ApiCommand): extHostTypes.Disposable; registerCommand(global: boolean, id: string, callback: (...args: any[]) => T | Thenable, thisArg?: any, metadata?: ICommandMetadata, extension?: IExtensionDescription): extHostTypes.Disposable; executeCommand(id: string, ...args: unknown[]): Promise; private _doExecuteCommand; private _executeContributedCommand; private _reportTelemetry; $executeContributedCommand(id: string, ...args: unknown[]): Promise; getCommands(filterUnderscoreCommands?: boolean): Promise; $getContributedCommandMetadata(): Promise<{ [id: string]: string | ICommandMetadataDto; }>; } export interface IExtHostCommands extends ExtHostCommands { } export declare const IExtHostCommands: import("../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; export declare class CommandsConverter implements extHostTypeConverter.Command.ICommandsConverter { private readonly _commands; private readonly _lookupApiCommand; private readonly _logService; readonly delegatingCommandId: string; private readonly _cache; private _cachIdPool; constructor(_commands: ExtHostCommands, _lookupApiCommand: (id: string) => ApiCommand | undefined, _logService: ILogService); toInternal(command: vscode.Command, disposables: DisposableStore): ICommandDto; toInternal(command: vscode.Command | undefined, disposables: DisposableStore): ICommandDto | undefined; fromInternal(command: ICommandDto): vscode.Command | undefined; getActualCommand(...args: any[]): vscode.Command | undefined; private _executeConvertedCommand; } export declare class ApiCommandArgument { readonly name: string; readonly description: string; readonly validate: (v: V) => boolean; readonly convert: (v: V) => O; static readonly Uri: ApiCommandArgument; static readonly Position: ApiCommandArgument; static readonly Range: ApiCommandArgument; static readonly Selection: ApiCommandArgument; static readonly Number: ApiCommandArgument; static readonly String: ApiCommandArgument; static Arr(element: ApiCommandArgument): ApiCommandArgument; static readonly CallHierarchyItem: ApiCommandArgument; static readonly TypeHierarchyItem: ApiCommandArgument; static readonly TestItem: ApiCommandArgument; static readonly TestProfile: ApiCommandArgument; constructor(name: string, description: string, validate: (v: V) => boolean, convert: (v: V) => O); optional(): ApiCommandArgument; with(name: string | undefined, description: string | undefined): ApiCommandArgument; } export declare class ApiCommandResult { readonly description: string; readonly convert: (v: V, apiArgs: any[], cmdConverter: CommandsConverter) => O; static readonly Void: ApiCommandResult; constructor(description: string, convert: (v: V, apiArgs: any[], cmdConverter: CommandsConverter) => O); } export declare class ApiCommand { readonly id: string; readonly internalId: string; readonly description: string; readonly args: ApiCommandArgument[]; readonly result: ApiCommandResult; constructor(id: string, internalId: string, description: string, args: ApiCommandArgument[], result: ApiCommandResult); }