UNPKG

sussudio

Version:

An unofficial VS Code Internal API

53 lines (52 loc) 1.89 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { ResolvedKeybinding } from "../../../common/keybindings.mjs"; import { OperatingSystem } from "../../../common/platform.mjs"; import "../../../../css!./keybindingLabel.mjs"; export interface ChordMatches { ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; keyCode?: boolean; } export interface Matches { firstPart: ChordMatches; chordPart: ChordMatches; } export interface KeybindingLabelOptions extends IKeybindingLabelStyles { renderUnboundKeybindings?: boolean; } export type CSSValueString = string; export interface IKeybindingLabelStyles { keybindingLabelBackground?: CSSValueString; keybindingLabelForeground?: CSSValueString; keybindingLabelBorder?: CSSValueString; keybindingLabelBottomBorder?: CSSValueString; keybindingLabelShadow?: CSSValueString; } export declare class KeybindingLabel { private os; private domNode; private options; private readonly keyElements; private keybinding; private matches; private didEverRender; private labelBackground; private labelBorder; private labelBottomBorder; private labelShadow; constructor(container: HTMLElement, os: OperatingSystem, options?: KeybindingLabelOptions); get element(): HTMLElement; set(keybinding: ResolvedKeybinding | undefined, matches?: Matches): void; private render; private clear; private renderChord; private renderKey; private renderUnbound; private createKeyElement; private static areSame; }