import { ColumnLayout } from '../../../contracts/src/index.js'; /** * Section types in Word documents. * Controls how section breaks create new pages. */ export declare enum SectionType { /** Section continues on same page */ CONTINUOUS = "continuous", /** Section starts on next page */ NEXT_PAGE = "nextPage", /** Section starts on next even page */ EVEN_PAGE = "evenPage", /** Section starts on next odd page */ ODD_PAGE = "oddPage" } export declare const DEFAULT_PARAGRAPH_SECTION_TYPE = SectionType.NEXT_PAGE; export declare const DEFAULT_BODY_SECTION_TYPE = SectionType.CONTINUOUS; /** * OOXML sectPr XML element structure */ export interface SectPrElement { type: 'element'; name: 'w:sectPr'; attributes?: Record; elements?: SectPrChildElement[]; } /** * Child elements within sectPr */ export interface SectPrChildElement { type: 'element'; name: string; attributes?: Record; elements?: SectPrChildElement[]; } /** * Paragraph properties structure that may contain sectPr */ export interface ParagraphProperties { sectPr?: SectPrElement | SectPrLikeObject; [key: string]: unknown; } /** * Alternative sectPr shape from normalized JSON (not OOXML element) */ export interface SectPrLikeObject { elements?: SectPrChildElement[]; [key: string]: unknown; } /** * Section signature tracks section properties to determine if a new section * requires a page boundary for Word compatibility. */ export type SectionSignature = { titlePg?: boolean; headerPx?: number; footerPx?: number; pageSizePx?: { w: number; h: number; }; orientation?: 'portrait' | 'landscape'; headerRefs?: Partial>; footerRefs?: Partial>; columnsPx?: ColumnLayout; numbering?: { format?: 'decimal' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman' | 'numberInDash'; start?: number; }; } | null; /** * Vertical alignment of content within a section/page. * Maps to OOXML w:vAlign values in sectPr. */ export type SectionVerticalAlign = 'top' | 'center' | 'bottom' | 'both'; /** * Section range represents a contiguous section in the document. * * Word uses "end-tagged" section semantics (ECMA-376 §17.6.17): a paragraph's * sectPr defines properties for the section ENDING at that paragraph, not * starting after it. All body children preceding the section-terminating * paragraph — paragraphs, tables, top-level drawings — belong to that section. * * `startNodeIndex`/`endNodeIndex` are computed over every top-level * `doc.content` child and are the authoritative boundaries for dispatching * section breaks at emission time. `startParagraphIndex`/`endParagraphIndex` * are retained for callers (SDT handlers) that count only paragraphs during * recursive descent. */ export interface SectionRange { sectionIndex: number; startNodeIndex: number; endNodeIndex: number; startParagraphIndex: number; endParagraphIndex: number; sectPr: SectPrElement | null; margins: { top?: number; right?: number; bottom?: number; left?: number; header: number; footer: number; } | null; pageSize: { w: number; h: number; } | null; orientation: 'portrait' | 'landscape' | null; columns: ColumnLayout | null; type: SectionType; /** True iff the section's `` was explicitly written in the source. * Distinguishes "the body sectPr defaulted to continuous because OOXML * omitted w:type" (sd-1655) from "an explicit w:type=continuous on the * body sectPr" (sd-1480). Only the explicit form triggers Word's * end-of-document column balancing for single-page sections. */ typeIsExplicit: boolean; titlePg: boolean; headerRefs?: Partial>; footerRefs?: Partial>; numbering?: { format?: 'decimal' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman' | 'numberInDash'; start?: number; }; vAlign?: SectionVerticalAlign; } //# sourceMappingURL=types.d.ts.map