{"size": 2633, "ext": "js", "max_stars_repo_path": "public/static/out/vs/platform/keybinding/common/baseResolvedKeybinding.js", "max_stars_repo_name": "maciejpedzich/teditor", "max_stars_repo_stars_event_min_datetime": "2018-02-13T06:06:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-03T09:40:45.000Z", "max_issues_repo_path": "public/static/out/vs/platform/keybinding/common/baseResolvedKeybinding.js", "max_issues_repo_name": "maciejpedzich/teditor", "max_issues_repo_issues_event_min_datetime": "2020-07-14T13:25:06.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-12T13:19:28.000Z", "max_forks_repo_path": "public/static/out/vs/platform/keybinding/common/baseResolvedKeybinding.js", "max_forks_repo_name": "maciejpedzich/teditor", "max_forks_repo_forks_event_min_datetime": "2018-12-17T02:37:12.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-11T02:19:03.000Z"}
{"max_stars_count": 84, "max_issues_count": 7, "max_forks_count": 27, "avg_line_length": 50.6346153846, "max_line_length": 197, "alphanum_fraction": 0.5974173946}
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
define(["require", "exports", "vs/base/common/errors", "vs/base/common/keybindingLabels", "vs/base/common/keyCodes"], function (require, exports, errors_1, keybindingLabels_1, keyCodes_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.BaseResolvedKeybinding = void 0;
    class BaseResolvedKeybinding extends keyCodes_1.ResolvedKeybinding {
        constructor(os, parts) {
            super();
            if (parts.length === 0) {
                throw errors_1.illegalArgument(`parts`);
            }
            this._os = os;
            this._parts = parts;
        }
        getLabel() {
            return keybindingLabels_1.UILabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getLabel(keybinding));
        }
        getAriaLabel() {
            return keybindingLabels_1.AriaLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getAriaLabel(keybinding));
        }
        getElectronAccelerator() {
            if (this._parts.length > 1) {
                // Electron cannot handle chords
                return null;
            }
            return keybindingLabels_1.ElectronAcceleratorLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getElectronAccelerator(keybinding));
        }
        getUserSettingsLabel() {
            return keybindingLabels_1.UserSettingsLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getUserSettingsLabel(keybinding));
        }
        isWYSIWYG() {
            return this._parts.every((keybinding) => this._isWYSIWYG(keybinding));
        }
        isChord() {
            return (this._parts.length > 1);
        }
        getParts() {
            return this._parts.map((keybinding) => this._getPart(keybinding));
        }
        _getPart(keybinding) {
            return new keyCodes_1.ResolvedKeybindingPart(keybinding.ctrlKey, keybinding.shiftKey, keybinding.altKey, keybinding.metaKey, this._getLabel(keybinding), this._getAriaLabel(keybinding));
        }
        getDispatchParts() {
            return this._parts.map((keybinding) => this._getDispatchPart(keybinding));
        }
    }
    exports.BaseResolvedKeybinding = BaseResolvedKeybinding;
});
//# __sourceMappingURL=baseResolvedKeybinding.js.map