import type { IImageOptions, IParagraphOptions, IPropertiesOptions, ISectionOptions, ITableCellOptions, ITableOfContentsOptions, ITableOptions, ITableRowOptions, OutputType } from 'docx'; /** * Options for generating DOCX documents */ export interface DocxOptions { sections?: ISectionOptions[]; title?: string; subject?: string; creator?: string; keywords?: string; description?: string; lastModifiedBy?: string; revision?: number; externalStyles?: IPropertiesOptions['externalStyles']; styles?: IPropertiesOptions['styles']; numbering?: IPropertiesOptions['numbering']; comments?: IPropertiesOptions['comments']; footnotes?: IPropertiesOptions['footnotes']; background?: IPropertiesOptions['background']; features?: IPropertiesOptions['features']; compatabilityModeVersion?: IPropertiesOptions['compatabilityModeVersion']; compatibility?: IPropertiesOptions['compatibility']; customProperties?: IPropertiesOptions['customProperties']; evenAndOddHeaderAndFooters?: IPropertiesOptions['evenAndOddHeaderAndFooters']; defaultTabStop?: IPropertiesOptions['defaultTabStop']; fonts?: IPropertiesOptions['fonts']; hyphenation?: IPropertiesOptions['hyphenation']; tableOfContents?: { title?: string; run?: Partial; }; image?: { paragraph?: Partial; run?: Pick; }; table?: { paragraph?: Partial; run?: Partial; row?: { paragraph?: Partial; run?: Partial; }; cell?: { paragraph?: Partial; run?: Partial; }; header?: { paragraph?: Partial; run?: Partial; }; }; details?: { summary?: { paragraph?: Partial; }; content?: { paragraph?: Partial; }; }; horizontalRule?: { paragraph?: Partial; }; /** * Watermark configuration. * Supports text watermarks (rendered to image) or custom image watermarks. */ watermark?: { /** Text content for the watermark (e.g. "CONFIDENTIAL", "DRAFT") */ text?: string; /** Custom image URL or base64 data URL for watermark (overrides text) */ image?: string; /** Font size for text watermark (default: 52) */ fontSize?: number; /** Font color in hex, no # prefix (default: "C0C0C0") */ color?: string; /** Font family (default: "Microsoft YaHei") */ fontFamily?: string; /** Rotation angle in degrees, counter-clockwise (default: 315, i.e. diagonal) */ rotation?: number; /** Opacity 0-1 (default: 0.3) */ opacity?: number; }; outputType: T; }