docxml
Version:
TypeScript (component) library for building and parsing a DOCX file
41 lines (40 loc) • 1.42 kB
TypeScript
import { type ComponentAncestor, Component } from '../classes/Component.js';
/**
* A type describing the components accepted as children of {@link Break}.
*/
export declare type BreakChild = never;
/**
* A type describing the props accepted by {@link Break}.
*/
export declare type BreakProps = {
/**
* Specifies the type of break, which determines the location for the following text.
* Defaults to `"textWrapping"`.
*/
type?: 'page' | 'column' | 'textWrapping' | null;
/**
* Specifies the location where text restarts when the value of the type attribute is
* `"textWrapping"`.
*/
clear?: 'left' | 'right' | 'all' | 'none' | null;
};
/**
* A component that represents a line break, page break or section break in a DOCX document. Place
* this in one of the `<Text>`, `<TextAddition>` or `<TextDeletion>` components.
*/
export declare class Break extends Component<BreakProps, BreakChild> {
static readonly children: string[];
static readonly mixed: boolean;
/**
* Creates an XML DOM node for this component instance.
*/
toNode(_ancestry: ComponentAncestor[]): 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): Break;
}