docxml
Version:
TypeScript (component) library for building and parsing a DOCX file
56 lines (55 loc) • 1.75 kB
TypeScript
import { Component } from '../classes/Component.js';
import { type Length } from '../utilities/length.js';
/**
* A type describing the components accepted as children of {@link WatermarkText}.
*/
export declare type WatermarkTextChild = never;
/**
* A type describing the props accepted by {@link WatermarkText}.
*
* The "style" option, which is part of both paragraph- and text properties, is always
* set to the _paragraph_ style -- the _text_ style is ignored.
*/
export declare type WatermarkTextProps = {
text: string;
horizontalAlign?: 'left' | 'center' | 'right' | null;
verticalAlign?: 'top' | 'center' | 'bottom' | null;
minFontSize?: Length | null;
boxWidth?: Length | null;
boxHeight?: Length | null;
/**
* The color of this text. Type as a hexidecimal code (`"ff0000"`) or a basic color name (`"red"`).
*/
color?: string | null;
font?: string | null;
/**
* The opacity of the watermark. Set to "1" for fully opaque, or to "0" for fully transparent (invisible), or
* anything in between.
*/
opacity?: number | null;
isBold?: boolean | null;
isItalic?: boolean | null;
};
/**
*
*/
export declare class WatermarkText extends Component<WatermarkTextProps, WatermarkTextChild> {
static readonly children: string[];
static readonly mixed: boolean;
/**
* Creates an XML DOM node for this component instance.
*
*
*
*
*/
toNode(): 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): WatermarkText;
}