docxml
Version:
TypeScript (component) library for building and parsing a DOCX file
33 lines (32 loc) • 1.25 kB
TypeScript
import './Text.js';
import { Component, ComponentAncestor, ComponentContext } from '../classes/Component.js';
import { type ChangeInformation } from '../utilities/changes.js';
import { type Text } from './Text.js';
import { type TextDeletion } from './TextDeletion.js';
/**
* A type describing the components accepted as children of {@link TextAddition}.
*/
export declare type TextAdditionChild = Text | TextAddition | TextDeletion;
/**
* A type describing the props accepted by {@link TextAddition}.
*/
export declare type TextAdditionProps = ChangeInformation;
/**
* A component that represents a change-tracked text that was inserted.
*/
export declare class TextAddition extends Component<TextAdditionProps, TextAdditionChild> {
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): TextAddition;
}