UNPKG

simple-odf

Version:

Open Document Format made easy using pure JavaScript and Node.js

53 lines (52 loc) 1.89 kB
import { OdfTextElement } from '../api/text'; export declare class OdfTextElementWriter { /** * @inheritdoc * @since 0.7.0 */ write(odfText: OdfTextElement, document: Document, parent: Element): void; /** * Creates a text node with the provided text and appends it to the parent element. * * @param {Document} document The XML document * @param {Element} parent The parent node * @param {string} text The text value of the text node * @since 0.3.0 */ private appendTextNode; /** * Creates a space node representing the specified number of space characters and appends it to the parent element. * If a single space character should be represented, the `c` attribute is omitted. * * @param {Document} document The XML document * @param {Element} parent The parent node * @param {number} count The number of space characters the node should represent * @since 0.3.0 */ private appendSpaceNode; /** * Creates a tabulation node and appends it to the parent element. * * @param {Document} document The XML document * @param {Element} parent The parent node * @since 0.3.0 */ private appendTabNode; /** * Creates a line break node and appends it to the parent element. * * @param {Document} document The XML document * @param {Element} parent The parent node * @since 0.3.0 */ private appendLineBreakNode; /** * Finds the next non-space character and returns the number of space characters that occur before. * * @param {string} text The text to search in * @param {number} offset The index at which to start the search * @returns {number} The number of space characters before the next non-space character * @since 0.3.0 */ private findNextNonSpaceCharacter; }