UNPKG

sprotty

Version:

A next-gen framework for graphical views

71 lines 4.16 kB
/******************************************************************************** * Copyright (c) 2019 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the Eclipse * Public License v. 2.0 are satisfied: GNU General Public License, version 2 * with the GNU Classpath Exception which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { AutocompleteResult, AutocompleteSettings } from "autocompleter"; import { Action } from 'sprotty-protocol/lib/actions'; import { LabeledAction } from "../../base/actions/action"; import { IActionDispatcherProvider } from "../../base/actions/action-dispatcher"; import { SModelElementImpl, SModelRootImpl } from "../../base/model/smodel"; import { AbstractUIExtension } from "../../base/ui-extensions/ui-extension"; import { DOMHelper } from "../../base/views/dom-helper"; import { KeyListener } from "../../base/views/key-tool"; import { ViewerOptions } from "../../base/views/viewer-options"; import { CommandPaletteActionProviderRegistry } from "./action-providers"; import { MousePositionTracker } from "../../base/views/mouse-tool"; export declare class CommandPalette extends AbstractUIExtension { static readonly ID = "command-palette"; static readonly isInvokePaletteKey: (event: KeyboardEvent) => boolean; protected loadingIndicatorClasses: string[]; protected xOffset: number; protected yOffset: number; protected defaultWidth: number; protected debounceWaitMs: number; protected noCommandsMsg: string; protected inputElement: HTMLInputElement; protected loadingIndicator: HTMLSpanElement; protected autoCompleteResult: AutocompleteResult; protected paletteIndex: number; protected contextActions?: LabeledAction[]; protected actionDispatcherProvider: IActionDispatcherProvider; protected actionProviderRegistry: CommandPaletteActionProviderRegistry; protected viewerOptions: ViewerOptions; protected domHelper: DOMHelper; protected mousePositionTracker: MousePositionTracker; id(): string; containerClass(): string; show(root: Readonly<SModelRootImpl>, ...contextElementIds: string[]): void; protected initializeContents(containerElement: HTMLElement): void; protected hideIfEscapeEvent(event: KeyboardEvent): any; protected cylceIfInvokePaletteKey(event: KeyboardEvent): any; protected cycle(): void; protected onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRootImpl>, ...selectedElementIds: string[]): void; protected autocompleteSettings(root: Readonly<SModelRootImpl>): AutocompleteSettings<LabeledAction>; protected onSelect(item: LabeledAction): void; protected updateAutoCompleteActions(update: (items: LabeledAction[]) => void, text: string, root: Readonly<SModelRootImpl>): void; protected onLoading(): void; protected onLoaded(success: 'success' | 'error'): void; protected renderLabeledActionSuggestion(item: LabeledAction, value: string): HTMLDivElement; protected renderIcon(itemElement: HTMLDivElement, iconId: string): void; protected getFontAwesomeIcon(iconId: string): string; protected getCodicon(iconId: string): string; protected filterActions(filterText: string, actions: LabeledAction[]): LabeledAction[]; protected customizeSuggestionContainer(container: HTMLDivElement, inputRect: ClientRect | DOMRect, maxHeight: number): void; hide(): void; protected executeAction(input: LabeledAction | Action[] | Action): void; } export declare class CommandPaletteKeyListener extends KeyListener { keyDown(element: SModelElementImpl, event: KeyboardEvent): Action[]; } //# sourceMappingURL=command-palette.d.ts.map