docxml
Version:
TypeScript (component) library for building and parsing a DOCX file
38 lines (37 loc) • 1.19 kB
TypeScript
import { type ComponentAncestor, Component } from '../classes/Component.js';
/**
* A type describing the components accepted as children of {@link Symbol}.
*/
export declare type SymbolChild = never;
/**
* A type describing the props accepted by {@link Symbol}.
*/
export declare type SymbolProps = {
/**
* Specifies the typeface used for this character. For example, `"Symbol"` (default) or `"WingDings"`.
*/
font?: string;
/**
* The character code to insert, as a number, for example `0xF0D5`
*/
code: number;
};
/**
* A component that represents a special character from a different font.
*/
export declare class Symbol extends Component<SymbolProps, SymbolChild> {
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): Symbol;
}