UNPKG

wed

Version:

Wed is a schema-aware editor for XML documents.

47 lines 1.7 kB
define(["require", "exports", "./domutil"], function (require, exports, domutil_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * A "GUI selector" is a CSS selector apt to be used in the GUI tree. */ class GUISelector { /** * @param value The value that the selector holds. */ constructor(value) { this.value = value; const existing = GUISelector.__cache[value]; if (existing !== undefined) { return existing; } GUISelector.__cache[value] = this; } /** * Make a GUI selector from a CSS selector, as-is. * * @param selector The value that the selector will hold. */ static makeVerbatim(selector) { return new GUISelector(selector); } /** * Make a GUI selector from a data selector. The limitations on the selector * are the same as for [["wed/domutil".toGUISelector]]. * * @param selector A selector fit for selecting in the data tree. * * @param namespaces The namespace mappings to use to convert prefixes in the * selector. * * @returns A [[GUISelector]] corresponding to the parameters used. */ static fromDataSelector(selector, namespaces) { return new GUISelector(domutil_1.toGUISelector(selector, namespaces)); } } // tslint:disable-next-line:variable-name GUISelector.__cache = Object.create(null); exports.GUISelector = GUISelector; }); // LocalWords: MPL //# sourceMappingURL=gui-selector.js.map