/** ECMA-376 Part 1 §20.4.3.4 (`ST_RelFromH`). */ export declare const ANCHOR_H_RELATIVE_VALUES: readonly ["margin", "page", "column", "character", "leftMargin", "rightMargin", "insideMargin", "outsideMargin"]; /** ECMA-376 Part 1 §20.4.3.5 (`ST_RelFromV`). */ export declare const ANCHOR_V_RELATIVE_VALUES: readonly ["margin", "page", "paragraph", "line", "topMargin", "bottomMargin", "insideMargin", "outsideMargin"]; /** ECMA-376 Part 1 §20.4.3.1 (`ST_AlignH`). */ export declare const ANCHOR_H_ALIGN_VALUES: readonly ["left", "right", "center", "inside", "outside"]; /** ECMA-376 Part 1 §20.4.3.2 (`ST_AlignV`). */ export declare const ANCHOR_V_ALIGN_VALUES: readonly ["top", "bottom", "center", "inside", "outside"]; export type AnchorHRelative = (typeof ANCHOR_H_RELATIVE_VALUES)[number]; export type AnchorVRelative = (typeof ANCHOR_V_RELATIVE_VALUES)[number]; export type AnchorAlignH = (typeof ANCHOR_H_ALIGN_VALUES)[number]; export type AnchorAlignV = (typeof ANCHOR_V_ALIGN_VALUES)[number]; export declare function isAnchorHRelative(value: unknown): value is AnchorHRelative; export declare function isAnchorVRelative(value: unknown): value is AnchorVRelative; export declare function isAnchorAlignH(value: unknown): value is AnchorAlignH; export declare function isAnchorAlignV(value: unknown): value is AnchorAlignV; export declare function isPositionedParagraphFrame(frame: T | undefined): frame is T & { wrap: 'around' | 'none'; }; export declare function isPagePositionedParagraphFrame(frame: { wrap?: string; vAnchor?: string; y?: number; } | undefined): frame is { wrap: 'around' | 'none'; vAnchor: 'page'; y: number; }; export declare function isPagePositionedFloatingTable(block: T | undefined): block is T & { kind: 'table'; anchor: { isAnchored: true; vRelativeFrom: 'page'; }; }; /** * Resolve the page-space origin used for page-anchored paragraph frames in a footer. * Invalid or negative bottom margins behave like a zero margin. */ export declare function resolveFooterPageFrameOriginY(pageHeight: number, bottomMargin?: number): number; export type ColumnLayoutForAnchor = { width: number; gap: number; count: number; widths?: number[]; gaps?: number[]; }; /** * Inputs for resolving the paint Y of an anchored image, drawing, or floating table. * `offsetV` is applied inside this function; callers must pass the resolved value to * text-wrap registration without adding `offsetV` again. */ export type ResolveAnchoredGraphicYInput = { anchor?: { simplePos?: { x: number; y: number; }; vRelativeFrom?: AnchorVRelative; alignV?: AnchorAlignV; offsetV?: number; }; objectHeight: number; contentTop: number; contentBottom: number; /** Bottom page margin in px (used when vRelativeFrom is `page`). */ pageBottomMargin?: number; /** * Anchor paragraph top Y (body cursor when laying out the anchor paragraph). * Used for `paragraph` and legacy (undefined vRelativeFrom) positioning. */ anchorParagraphY?: number; /** Anchor line top Y. Falls back to the paragraph top when unavailable. */ anchorLineY?: number; /** First line height of the anchor paragraph (paragraph-relative alignV). */ firstLineHeight?: number; /** One-based physical page number, used by inside/outside placement. */ pageNumber?: number; /** * When true, anchor has no host paragraph (pre-registered / paragraphless layout). * For `vRelativeFrom: 'paragraph'`, use `contentTop + offsetV` instead of alignV on a * synthetic paragraph (defaults would wrongly center/bottom against contentTop). */ preRegisteredFallbackToContentTop?: boolean; }; /** * Resolve the vertical paint position for an anchored graphic (image, drawing, or table). */ export declare function resolveAnchoredGraphicY(input: ResolveAnchoredGraphicYInput): number; export type ResolveAnchoredGraphicXContext = { /** One-based physical page number, used by inside/outside placement. */ pageNumber?: number; /** Page-space X of the anchor character. Falls back to the column origin. */ anchorCharacterX?: number; }; /** * Resolve horizontal paint position for an anchored graphic. */ export declare function resolveAnchoredGraphicX(anchor: { simplePos?: { x: number; y: number; }; hRelativeFrom?: AnchorHRelative; alignH?: AnchorAlignH; offsetH?: number; }, columnIndex: number, columns: ColumnLayoutForAnchor, objectWidth: number, margins?: { left?: number; right?: number; }, pageWidth?: number, context?: ResolveAnchoredGraphicXContext): number;