wed
Version:
Wed is a schema-aware editor for XML documents.
36 lines • 1.33 kB
JavaScript
/**
* Facilities for managing the selection mode.
*
* @author Louis-Dominique Dubeau
* @license MPL 2.0
* @copyright Mangalam Research Center for Buddhist Languages
*/
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SelectionMode;
(function (SelectionMode) {
/** The span mode allows creating selections character-by-character. */
SelectionMode[SelectionMode["SPAN"] = 0] = "SPAN";
/**
* The unit mode restricts selections to entire units. Like an entire element,
* or an entire attribute.
*/
SelectionMode[SelectionMode["UNIT"] = 1] = "UNIT";
})(SelectionMode = exports.SelectionMode || (exports.SelectionMode = {}));
(function (SelectionMode) {
/**
* Get the selection mode that follows another mode.
*
* @param mode A selection mode.
*
* @returns The mode that follows `mode`.
*/
function next(mode) {
const ret = mode + 1;
return (SelectionMode[ret] === undefined) ? 0 : ret;
}
SelectionMode.next = next;
})(SelectionMode = exports.SelectionMode || (exports.SelectionMode = {}));
});
//# sourceMappingURL=selection-mode.js.map