import type { Paragraph, Table } from "docx"; import type { StyleResolver } from "./style-resolver.js"; import type { InlineFieldOptions } from "./fields.js"; export type DocxBlock = Paragraph | Table; export interface BlockBorderSide { color: string; size: number; space: number; } export interface BlockBorders { top?: BlockBorderSide; bottom?: BlockBorderSide; left?: BlockBorderSide; right?: BlockBorderSide; } /** Paragraph-level layout: shading, borders, spacing, indentation. */ export interface BlockLayout { alignment?: (typeof import("docx").AlignmentType)[keyof typeof import("docx").AlignmentType]; shading?: { fill?: string; color?: string; }; spacingBefore?: number; spacingAfter?: number; indentLeft?: number; indentRight?: number; /** Hanging indent (twips) — first line outdents left of indentLeft (list markers). */ hangingIndent?: number; paddingTop?: number; paddingBottom?: number; paddingLeft?: number; paddingRight?: number; marginTop?: number; marginBottom?: number; marginLeft?: number; marginRight?: number; /** Explicit block width from CSS (`width`), in twips. */ widthTwips?: number; /** Explicit block width from CSS (`width`), as percent of content width. */ widthPercent?: number; /** Optional CSS `max-width` clamp in twips. */ maxWidthTwips?: number; borders?: BlockBorders; /** Line box height (px) for EXACT shaded paragraphs; defaults to body line height. */ shadedContentLinePx?: number; /** CSS `line-height` as a unitless multiplier (e.g. 1.5). */ lineHeight?: number; /** Font size (half-points) for shaded padding tab runs. */ shadedTabHalfPoints?: number; /** Force a page break before this paragraph (CSS break-before / class). */ pageBreakBefore?: boolean; /** Request a page break before the next block sibling (CSS break-after / class). */ pageBreakAfter?: boolean; } export interface FlexLayout { direction: "row" | "column"; gap?: number; } export interface RunTypography { bold?: boolean; italics?: boolean; underline?: boolean; /** Display-only uppercase (`w:caps`) — CSS `text-transform: uppercase`. */ allCaps?: boolean; /** Extra tracking between characters in twips — CSS `letter-spacing`. */ characterSpacing?: number; /** CSS `vertical-align: super` → `w:vertAlign superscript`. */ superScript?: boolean; /** CSS `vertical-align: sub` → `w:vertAlign subscript`. */ subScript?: boolean; color?: string; fontSize?: number; font?: string; style?: string; shading?: { fill?: string; color?: string; }; } export type BlockStyle = BlockLayout; /** @deprecated alias — use RunTypography */ export type RunStyle = RunTypography; export interface VisitorContext { blockquoteDepth: number; /** Numbering reference (see LIST_STYLE_REFERENCES); ordered refs start with "numbers". */ listRef?: string; listLevel: number; inheritedLayout?: BlockLayout; styleResolver: StyleResolver; /** Default run size (half-points) for text with no explicit CSS font-size. */ defaultSizeHalfPoints: number; /** * Inside a flex-item's block children: use EXACT per-font line boxes (CSS line-height) * instead of AUTO, so stacked card lines don't inflate vertically vs the browser. */ flexBlockContent?: boolean; /** When true, the next visited block starts on a new page (prior sibling had break-after). */ pageBreakBeforeNext?: boolean; /** Allowlisted Word fields in inline content (page chrome only). */ fieldOptions?: InlineFieldOptions; } export declare const DEFAULT_VISITOR_CONTEXT: VisitorContext; //# sourceMappingURL=types.d.ts.map