import { JupyterFrontEnd } from '@jupyterlab/application'; import { ICommandPalette, IWidgetTracker } from '@jupyterlab/apputils'; import { CodeEditor } from '@jupyterlab/codeeditor'; import { IDocumentWidget } from '@jupyterlab/docregistry'; import { WidgetAdapter } from './adapters/adapter'; import { LSPConnection } from './connection'; import { IFeatureCommand, IFeatureEditorIntegration } from './feature'; import { IRootPosition, IVirtualPosition } from './positioning'; import { ILSPAdapterManager, ILSPLogConsole } from './tokens'; import { VirtualDocument } from './virtual/document'; import { IVirtualEditor } from './virtual/editor'; export declare type CommandEntryPoint = string; export interface ILSPCommandManagerOptions { adapter_manager: ILSPAdapterManager; app: JupyterFrontEnd; palette: ICommandPalette; tracker: IWidgetTracker; suffix: string; entry_point: CommandEntryPoint; console: ILSPLogConsole; } declare abstract class LSPCommandManager { protected adapter_manager: ILSPAdapterManager; protected app: JupyterFrontEnd; protected palette: ICommandPalette; protected tracker: IWidgetTracker; protected suffix: string; protected entry_point: CommandEntryPoint; protected constructor(options: ILSPCommandManagerOptions); get current_adapter(): WidgetAdapter>; abstract attach_command(command: IFeatureCommand): void; abstract execute(command: IFeatureCommand): void; abstract is_enabled(command: IFeatureCommand): boolean; abstract is_visible(command: IFeatureCommand): boolean; add_to_palette: boolean; category: string; add(commands: Array): void; protected should_attach(command: IFeatureCommand): boolean; protected create_id(command: IFeatureCommand): string; } export interface IContextMenuOptions { selector: string; rank_group?: number; rank_group_size?: number; callback?(manager: ContextCommandManager): void; } export interface ILSPContextManagerOptions extends ILSPCommandManagerOptions, IContextMenuOptions { } /** * Contextual commands, with the context retrieved from the ContextMenu * position (if open) or from the cursor in the current widget. */ export declare class ContextCommandManager extends LSPCommandManager { protected selector: string; entry_point: CommandEntryPoint; protected rank_group?: number; protected rank_group_size?: number; protected console: ILSPLogConsole; constructor(options: ILSPContextManagerOptions); attach_command(command: IFeatureCommand): void; add_context_separator(position_in_group: number): void; execute(command: IFeatureCommand): void; protected get is_context_menu_open(): boolean; protected get is_widget_current(): boolean; is_enabled(): boolean; get_context(): ICommandContext | null; is_visible(command: IFeatureCommand): boolean; protected get_rank(command: IFeatureCommand): number; } export interface ICommandContext { app: JupyterFrontEnd; document: VirtualDocument; connection?: LSPConnection; virtual_position: IVirtualPosition; root_position: IRootPosition; features: Map>; editor: IVirtualEditor; adapter: WidgetAdapter; } export {};