sussudio
Version:
An unofficial VS Code Internal API
62 lines (61 loc) • 2.29 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IContextMenuProvider } from "../../contextmenu.mjs";
import { IMenuOptions } from "../menu/menu.mjs";
import { ActionRunner, IAction } from "../../../common/actions.mjs";
import { IDisposable } from "../../../common/lifecycle.mjs";
import "../../../../css!./dropdown.mjs";
export interface ILabelRenderer {
(container: HTMLElement): IDisposable | null;
}
interface IBaseDropdownOptions {
label?: string;
labelRenderer?: ILabelRenderer;
}
declare class BaseDropdown extends ActionRunner {
private _element;
private boxContainer?;
private _label?;
private contents?;
private visible;
private _onDidChangeVisibility;
readonly onDidChangeVisibility: import("../../../common/event.mjs").Event<boolean>;
constructor(container: HTMLElement, options: IBaseDropdownOptions);
get element(): HTMLElement;
get label(): HTMLElement | undefined;
set tooltip(tooltip: string);
show(): void;
hide(): void;
isVisible(): boolean;
protected onEvent(_e: Event, activeElement: HTMLElement): void;
dispose(): void;
}
export interface IActionProvider {
getActions(): readonly IAction[];
}
export interface IDropdownMenuOptions extends IBaseDropdownOptions {
contextMenuProvider: IContextMenuProvider;
readonly actions?: IAction[];
readonly actionProvider?: IActionProvider;
menuClassName?: string;
menuAsChild?: boolean;
}
export declare class DropdownMenu extends BaseDropdown {
private _contextMenuProvider;
private _menuOptions;
private _actions;
private actionProvider?;
private menuClassName;
private menuAsChild?;
constructor(container: HTMLElement, options: IDropdownMenuOptions);
set menuOptions(options: IMenuOptions | undefined);
get menuOptions(): IMenuOptions | undefined;
private get actions();
private set actions(value);
show(): void;
hide(): void;
private onHide;
}
export {};