UNPKG

docxml

Version:

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

37 lines (36 loc) 1.44 kB
/** * @file * Note this file is 99% the same as RowDeletion. Please maintain both accordingly. */ import { Component, ComponentAncestor, ComponentContext } from '../classes/Component.js'; import { type TableRowProperties } from '../properties/table-row-properties.js'; import { type ChangeInformation } from '../utilities/changes.js'; import { type RowChild } from './Row.js'; /** * A type describing the components accepted as children of {@link RowAddition}. */ export declare type RowAdditionChild = RowChild; /** * A type describing the props accepted by {@link RowAddition}. */ export declare type RowAdditionProps = ChangeInformation & TableRowProperties; /** * A component that represents a change-tracked table row that was inserted. Works the same way as * a normal row, but requires some props describing the change. */ export declare class RowAddition extends Component<RowAdditionProps, RowAdditionChild> { static readonly children: string[]; static readonly mixed: boolean; /** * Creates an XML DOM node for this component instance. */ toNode(ancestry: ComponentAncestor[]): Promise<Node>; /** * Asserts whether or not a given XML node correlates with this component. */ static matchesNode(node: Node): boolean; /** * Instantiate this component from the XML in an existing DOCX file. */ static fromNode(node: Node, context: ComponentContext): RowAddition; }