sussudio
Version:
An unofficial VS Code Internal API
78 lines (77 loc) • 2.96 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 { IKeyboardEvent } from "../../keyboardEvent.mjs";
import { BaseActionViewItem, IActionViewItemOptions } from "../actionbar/actionViewItems.mjs";
import { Widget } from "../widget.mjs";
import { IAction } from "../../../common/actions.mjs";
import { CSSIcon } from "../../../common/codicons.mjs";
import { Event } from "../../../common/event.mjs";
import "../../../../css!./toggle.mjs";
export interface IToggleOpts extends IToggleStyles {
readonly actionClassName?: string;
readonly icon?: CSSIcon;
readonly title: string;
readonly isChecked: boolean;
readonly notFocusable?: boolean;
}
export interface IToggleStyles {
readonly inputActiveOptionBorder: string | undefined;
readonly inputActiveOptionForeground: string | undefined;
readonly inputActiveOptionBackground: string | undefined;
}
export interface ICheckboxStyles {
readonly checkboxBackground: string | undefined;
readonly checkboxBorder: string | undefined;
readonly checkboxForeground: string | undefined;
}
export declare const unthemedToggleStyles: {
inputActiveOptionBorder: string;
inputActiveOptionForeground: string;
inputActiveOptionBackground: string;
};
export declare class ToggleActionViewItem extends BaseActionViewItem {
protected readonly toggle: Toggle;
constructor(context: any, action: IAction, options: IActionViewItemOptions);
render(container: HTMLElement): void;
protected updateEnabled(): void;
protected updateChecked(): void;
focus(): void;
blur(): void;
setFocusable(focusable: boolean): void;
}
export declare class Toggle extends Widget {
private readonly _onChange;
readonly onChange: Event<boolean>;
private readonly _onKeyDown;
readonly onKeyDown: Event<IKeyboardEvent>;
private readonly _opts;
private _icon;
readonly domNode: HTMLElement;
private _checked;
constructor(opts: IToggleOpts);
get enabled(): boolean;
focus(): void;
get checked(): boolean;
set checked(newIsChecked: boolean);
setIcon(icon: CSSIcon | undefined): void;
width(): number;
protected applyStyles(): void;
enable(): void;
disable(): void;
setTitle(newTitle: string): void;
}
export declare class Checkbox extends Widget {
private title;
private isChecked;
private checkbox;
private styles;
readonly domNode: HTMLElement;
constructor(title: string, isChecked: boolean, styles: ICheckboxStyles);
get checked(): boolean;
set checked(newIsChecked: boolean);
focus(): void;
hasFocus(): boolean;
protected applyStyles(): void;
}