docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
103 lines (102 loc) • 4.03 kB
TypeScript
import { IBorderOptions } from '../../border';
import { IShadingAttributesProperties } from '../../shading';
import { IChangedAttributesProperties } from '../../track-revision/track-revision';
import { IgnoreIfEmptyXmlComponent, XmlComponent } from '../../xml-components';
import { PositiveUniversalMeasure, UniversalMeasure } from '../../../util/values';
import { EmphasisMarkType } from './emphasis-mark';
import { ILanguageOptions } from './language';
import { IFontAttributesProperties } from './run-fonts';
import { UnderlineType } from './underline';
type IFontOptions = {
readonly name: string;
readonly hint?: string;
};
export declare const TextEffect: {
readonly BLINK_BACKGROUND: "blinkBackground";
readonly LIGHTS: "lights";
readonly ANTS_BLACK: "antsBlack";
readonly ANTS_RED: "antsRed";
readonly SHIMMER: "shimmer";
readonly SPARKLE: "sparkle";
readonly NONE: "none";
};
export declare const HighlightColor: {
readonly BLACK: "black";
readonly BLUE: "blue";
readonly CYAN: "cyan";
readonly DARK_BLUE: "darkBlue";
readonly DARK_CYAN: "darkCyan";
readonly DARK_GRAY: "darkGray";
readonly DARK_GREEN: "darkGreen";
readonly DARK_MAGENTA: "darkMagenta";
readonly DARK_RED: "darkRed";
readonly DARK_YELLOW: "darkYellow";
readonly GREEN: "green";
readonly LIGHT_GRAY: "lightGray";
readonly MAGENTA: "magenta";
readonly NONE: "none";
readonly RED: "red";
readonly WHITE: "white";
readonly YELLOW: "yellow";
};
export type IRunStylePropertiesOptions = {
readonly noProof?: boolean;
readonly bold?: boolean;
readonly boldComplexScript?: boolean;
readonly italics?: boolean;
readonly italicsComplexScript?: boolean;
readonly underline?: {
readonly color?: string;
readonly type?: (typeof UnderlineType)[keyof typeof UnderlineType];
};
readonly effect?: (typeof TextEffect)[keyof typeof TextEffect];
readonly emphasisMark?: {
readonly type?: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType];
};
readonly color?: string;
readonly kern?: number | PositiveUniversalMeasure;
readonly position?: UniversalMeasure;
readonly size?: number | PositiveUniversalMeasure;
readonly sizeComplexScript?: boolean | number | PositiveUniversalMeasure;
readonly rightToLeft?: boolean;
readonly smallCaps?: boolean;
readonly allCaps?: boolean;
readonly strike?: boolean;
readonly doubleStrike?: boolean;
readonly subScript?: boolean;
readonly superScript?: boolean;
readonly font?: string | IFontOptions | IFontAttributesProperties;
readonly highlight?: (typeof HighlightColor)[keyof typeof HighlightColor];
readonly highlightComplexScript?: boolean | string;
readonly characterSpacing?: number;
readonly shading?: IShadingAttributesProperties;
readonly emboss?: boolean;
readonly imprint?: boolean;
readonly revision?: IRunPropertiesChangeOptions;
readonly language?: ILanguageOptions;
readonly border?: IBorderOptions;
readonly snapToGrid?: boolean;
readonly vanish?: boolean;
readonly specVanish?: boolean;
readonly scale?: number;
readonly math?: boolean;
};
export type IRunPropertiesOptions = {
readonly style?: string;
} & IRunStylePropertiesOptions;
export type IRunPropertiesChangeOptions = {} & IRunPropertiesOptions & IChangedAttributesProperties;
export type IParagraphRunPropertiesOptions = {
readonly insertion?: IChangedAttributesProperties;
readonly deletion?: IChangedAttributesProperties;
} & IRunPropertiesOptions;
export declare class RunProperties extends IgnoreIfEmptyXmlComponent {
constructor(options?: IRunPropertiesOptions);
push(item: XmlComponent): void;
}
export declare class ParagraphRunProperties extends RunProperties {
constructor(options?: IParagraphRunPropertiesOptions);
}
export declare class RunPropertiesChange extends XmlComponent {
constructor(options: IRunPropertiesChangeOptions);
}
export {};