UNPKG

docxml

Version:

TypeScript (component) library for building and parsing a DOCX file

45 lines (44 loc) 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NonBreakingHyphen = void 0; const Component_js_1 = require("../classes/Component.js"); const components_js_1 = require("../utilities/components.js"); const dom_js_1 = require("../utilities/dom.js"); const namespaces_js_1 = require("../utilities/namespaces.js"); /** * A component that represents a non-breaking hyphen. Place this in the `<Text>` component. */ class NonBreakingHyphen extends Component_js_1.Component { /** * Creates an XML DOM node for this component instance. */ toNode() { return (0, dom_js_1.create)(`element ${namespaces_js_1.QNS.w}noBreakHyphen {}`); } /** * Asserts whether or not a given XML node correlates with this component. */ static matchesNode(node) { return node.nodeName === 'w:noBreakHyphen'; } /** * Instantiate this component from the XML in an existing DOCX file. */ static fromNode() { return new NonBreakingHyphen({}); } } exports.NonBreakingHyphen = NonBreakingHyphen; Object.defineProperty(NonBreakingHyphen, "children", { enumerable: true, configurable: true, writable: true, value: [] }); Object.defineProperty(NonBreakingHyphen, "mixed", { enumerable: true, configurable: true, writable: true, value: false }); (0, components_js_1.registerComponent)(NonBreakingHyphen);