UNPKG

sussudio

Version:

An unofficial VS Code Internal API

58 lines (57 loc) 2.48 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Codicon } from "../../../base/common/codicons.mjs"; import { ResolvedKeybinding } from "../../../base/common/keybindings.mjs"; import { Disposable } from "../../../base/common/lifecycle.mjs"; import "../../../css!./actionWidget.mjs"; import { IActionItem } from "../common/actionWidget.mjs"; import { IContextViewService } from "../../contextview/browser/contextView.mjs"; import { IKeybindingService } from "../../keybinding/common/keybinding.mjs"; export declare const acceptSelectedActionCommand = "acceptSelectedCodeAction"; export declare const previewSelectedActionCommand = "previewSelectedCodeAction"; export interface IRenderDelegate { onHide(didCancel?: boolean): void; onSelect(action: IActionItem, preview?: boolean): Promise<any>; } export interface IListMenuItem<T extends IActionItem> { readonly item?: T; readonly kind: ActionListItemKind; readonly group?: { kind?: any; icon?: { codicon: Codicon; color?: string; }; title: string; }; readonly disabled?: boolean; readonly label?: string; readonly description?: string; readonly keybinding?: ResolvedKeybinding; } export declare const enum ActionListItemKind { Action = "action", Header = "header" } export declare class ActionList<T extends IActionItem> extends Disposable { private readonly _delegate; private readonly _contextViewService; private readonly _keybindingService; readonly domNode: HTMLElement; private readonly _list; private readonly _actionLineHeight; private readonly _headerLineHeight; private readonly _allMenuItems; constructor(user: string, preview: boolean, items: readonly IListMenuItem<T>[], _delegate: IRenderDelegate, _contextViewService: IContextViewService, _keybindingService: IKeybindingService); private focusCondition; hide(didCancel?: boolean): void; layout(minWidth: number): number; focusPrevious(): void; focusNext(): void; acceptSelected(preview?: boolean): void; private onListSelection; private onListHover; private onListClick; }