## API Report File for "@eigenpal/docx-editor-core"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

// @public
export function applyPendingToActive(state: SectionState): SectionState;

// @public
export function assertExhaustiveFlowBlock(block: never, site: string): never;

// @public
export type BlockId = string | number;

// @public
export type BorderStyle = {
    style?: string;
    width?: number;
    color?: string;
    space?: number;
};

// @public
export type BreakDecision = {
    forcePageBreak: boolean;
    forceMidPageRegion: boolean;
    requiredParity?: 'even' | 'odd';
};

// @public
export function calculateChainHeight(chain: KeepNextChain, blocks: FlowBlock[], measures: Measure[]): number;

// @public
export type CellBorders = {
    top?: CellBorderSpec;
    bottom?: CellBorderSpec;
    left?: CellBorderSpec;
    right?: CellBorderSpec;
};

// @public
export type CellBorderSpec = {
    width?: number;
    color?: string;
    style?: string;
};

// @internal
export function collectSectionConfigs(blocks: FlowBlock[], initialConfig: SectionLayoutConfig, finalConfig: SectionLayoutConfig): {
    configs: SectionLayoutConfig[];
    breakIndices: number[];
};

// @public
export type ColumnBreakBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'columnBreak';
    id: BlockId;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type ColumnBreakMeasure = {
    kind: 'columnBreak';
};

// @public
export type ColumnLayout = {
    count: number;
    gap: number;
    equalWidth?: boolean;
    separator?: boolean;
};

// @public
export function computeKeepNextChains(blocks: FlowBlock[]): Map<number, KeepNextChain>;

// @public
export function createInitialSectionState(margins: PageMargins, pageSize: {
    w: number;
    h: number;
}, columns?: ColumnLayout): SectionState;

// @public
export function createPaginator(options: PaginatorOptions): {
    pages: Page[];
    states: PageState[];
    readonly columnWidth: number;
    readonly columns: {
        count: number;
        gap: number;
        equalWidth?: boolean;
        separator?: boolean;
    };
    getCurrentState: () => PageState;
    getAvailableHeight: () => number;
    getContentWidth: () => number;
    fits: (height: number) => boolean;
    ensureFits: (height: number) => PageState;
    addFragment: (fragment: Fragment, height: number, spaceBefore?: number, spaceAfter?: number) => {
        state: PageState;
        x: number;
        y: number;
    };
    forcePageBreak: () => PageState;
    forceColumnBreak: () => PageState;
    getColumnX: (columnIndex: number) => number;
    updateColumns: (newColumns: ColumnLayout) => void;
    updatePageLayout: (newPageSize?: {
        w: number;
        h: number;
    }, newMargins?: PageMargins, applyImmediately?: boolean) => void;
};

// @public
export const DEFAULT_TEXTBOX_MARGINS: {
    top: number;
    bottom: number;
    left: number;
    right: number;
};

// @public
export const DEFAULT_TEXTBOX_WIDTH = 200;

// @public
export type DocumentPosition = {
    blockIndex: number;
    runIndex?: number;
    charOffset?: number;
    pmPos?: number;
};

// @public
export type FieldRun = RunFormatting & {
    kind: 'field';
    fieldType: 'PAGE' | 'NUMPAGES' | 'DATE' | 'TIME' | 'OTHER';
    fallback?: string;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export function findPageIndexContainingPmPos(layout: Layout, pmPos: number): number | null;

// @public
export type FloatingTablePosition = {
    horzAnchor?: 'margin' | 'page' | 'text';
    vertAnchor?: 'margin' | 'page' | 'text';
    tblpX?: number;
    tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside';
    tblpY?: number;
    tblpYSpec?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
    topFromText?: number;
    bottomFromText?: number;
    leftFromText?: number;
    rightFromText?: number;
};

// @public
export function floatingTextBoxReservesBand(block: TextBoxFlowAttrs): boolean;

// @public
export function floatingTextBoxWrapsText(block: TextBoxFlowAttrs): boolean;

// @public
export type FlowBlock = ParagraphBlock | TableBlock | ImageBlock | TextBoxBlock | SectionBreakBlock | PageBreakBlock | ColumnBreakBlock;

// @public
export type FootnoteContent = {
    id: number;
    displayNumber: number;
    blocks: FlowBlock[];
    measures: Measure[];
    height: number;
};

// @public
export type Fragment = ParagraphFragment | TableFragment | ImageFragment | TextBoxFragment;

// @public
export type FragmentBase = {
    blockId: BlockId;
    x: number;
    y: number;
    width: number;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export function getEffectiveColumns(state: SectionState): ColumnLayout;

// @public
export function getEffectiveMargins(state: SectionState): PageMargins;

// @public
export function getEffectivePageSize(state: SectionState): {
    w: number;
    h: number;
};

// @public
export function getHeaderRowsHeight(measure: TableMeasure, headerRowCount: number): number;

// @public
export function getMidChainIndices(chains: Map<number, KeepNextChain>): Set<number>;

// @public
export function hasKeepLines(block: FlowBlock): boolean;

// @public
export function hasPageBreakBefore(block: FlowBlock): boolean;

// @public
export type HeaderFooterContentHeights = Partial<Record<'default' | 'first' | 'even' | 'odd', number>>;

// @public
export type HeaderFooterLayout = {
    height: number;
    fragments: Fragment[];
};

// @public
export type HitTestResult = {
    pageIndex: number;
    fragment?: Fragment;
    localX?: number;
    localY?: number;
};

// @public
export type HyperlinkInfo = {
    href: string;
    tooltip?: string;
    noDefaultStyle?: boolean;
};

// @public
export type ImageBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'image';
    id: BlockId;
    src: string;
    width: number;
    height: number;
    alt?: string;
    transform?: string;
    anchor?: {
        isAnchored?: boolean;
        offsetH?: number;
        offsetV?: number;
        behindDoc?: boolean;
    };
    hlinkHref?: string;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type ImageFragment = FragmentBase & {
    kind: 'image';
    height: number;
    isAnchored?: boolean;
    zIndex?: number;
};

// @public
export type ImageMeasure = {
    kind: 'image';
    width: number;
    height: number;
};

// @public
export type ImageRun = {
    kind: 'image';
    src: string;
    width: number;
    height: number;
    alt?: string;
    transform?: string;
    position?: ImageRunPosition;
    wrapType?: string;
    displayMode?: 'inline' | 'block' | 'float';
    cssFloat?: 'left' | 'right' | 'none';
    distTop?: number;
    distBottom?: number;
    distLeft?: number;
    distRight?: number;
    cropTop?: number;
    cropRight?: number;
    cropBottom?: number;
    cropLeft?: number;
    opacity?: number;
    isInsertion?: boolean;
    isDeletion?: boolean;
    changeAuthor?: string;
    changeDate?: string;
    changeRevisionId?: number;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type ImageRunPosition = {
    horizontal?: {
        relativeTo?: string;
        posOffset?: number;
        align?: string;
    };
    vertical?: {
        relativeTo?: string;
        posOffset?: number;
        align?: string;
    };
};

// @public
export interface InlineSdtWidget {
    alias?: string;
    checked?: boolean;
    groupId: string;
    // (undocumented)
    kind: 'checkbox';
    pos: number;
    tag?: string;
}

// @public
export function isFloatingTextBoxBlock(block: TextBoxFlowAttrs): boolean;

// @public
export function isFloatingWrapType(wrapType: string | undefined): boolean;

// @public
export function isWrapNone(wrapType: string | undefined): boolean;

// @public
export type KeepNextChain = {
    startIndex: number;
    endIndex: number;
    memberIndices: number[];
    anchorIndex: number;
};

// @public
export type Layout = {
    pageSize: {
        w: number;
        h: number;
    };
    pages: Page[];
    columns?: ColumnLayout;
    headers?: Record<string, HeaderFooterLayout>;
    footers?: Record<string, HeaderFooterLayout>;
    pageGap?: number;
};

// @public
export function layoutDocument(blocks: FlowBlock[], measures: Measure[], options?: LayoutOptions): Layout;

// @public
export type LayoutOptions = {
    pageSize: {
        w: number;
        h: number;
    };
    margins: PageMargins;
    finalPageSize?: {
        w: number;
        h: number;
    };
    finalMargins?: PageMargins;
    columns?: ColumnLayout;
    pageGap?: number;
    defaultLineHeight?: number;
    headerContentHeights?: HeaderFooterContentHeights;
    footerContentHeights?: HeaderFooterContentHeights;
    titlePage?: boolean;
    evenAndOddHeaders?: boolean;
    footnoteReservedHeights?: Map<number, number>;
    bodyBreakType?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
};

// @public
export type LineBreakRun = {
    kind: 'lineBreak';
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type ListNumPr = {
    numId?: number;
    ilvl?: number;
};

// @public
export type Measure = ParagraphMeasure | ImageMeasure | TableMeasure | TextBoxMeasure | SectionBreakMeasure | PageBreakMeasure | ColumnBreakMeasure;

// @public
export type MeasuredLine = {
    fromRun: number;
    fromChar: number;
    toRun: number;
    toChar: number;
    width: number;
    ascent: number;
    descent: number;
    lineHeight: number;
    leftOffset?: number;
    rightOffset?: number;
    segments?: MeasuredLineSegment[];
    floatSkipBefore?: number;
};

// @public (undocumented)
export type MeasuredLineSegment = {
    fromRun: number;
    fromChar: number;
    toRun: number;
    toChar: number;
    width: number;
    leftOffset: number;
    availableWidth: number;
};

// @public
export type Page = {
    number: number;
    fragments: Fragment[];
    margins: PageMargins;
    size: {
        w: number;
        h: number;
    };
    orientation?: 'portrait' | 'landscape';
    sectionIndex?: number;
    headerFooterRefs?: {
        headerDefault?: string;
        headerFirst?: string;
        headerEven?: string;
        footerDefault?: string;
        footerFirst?: string;
        footerEven?: string;
    };
    footnoteIds?: number[];
    footnoteReservedHeight?: number;
    columns?: ColumnLayout;
};

// @public
export type PageBreakBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'pageBreak';
    id: BlockId;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type PageBreakMeasure = {
    kind: 'pageBreak';
};

// @public
export type PageMargins = {
    top: number;
    right: number;
    bottom: number;
    left: number;
    header?: number;
    footer?: number;
};

// @public
export type PageState = {
    page: Page;
    cursorY: number;
    columnIndex: number;
    topMargin: number;
    contentBottom: number;
    trailingSpacing: number;
};

// @public (undocumented)
export type Paginator = ReturnType<typeof createPaginator>;

// @public
export type PaginatorOptions = {
    pageSize: {
        w: number;
        h: number;
    };
    margins: PageMargins;
    columns?: ColumnLayout;
    footnoteReservedHeights?: Map<number, number>;
    onNewPage?: (state: PageState) => void;
};

// @public
export type ParagraphAttrs = {
    alignment?: 'left' | 'center' | 'right' | 'justify';
    spacing?: ParagraphSpacing;
    spacingExplicit?: {
        before?: boolean;
        after?: boolean;
    };
    indent?: ParagraphIndent;
    keepNext?: boolean;
    keepLines?: boolean;
    pageBreakBefore?: boolean;
    styleId?: string;
    contextualSpacing?: boolean;
    bidi?: boolean;
    borders?: ParagraphBorders;
    shading?: string;
    tabs?: TabStop[];
    numPr?: ListNumPr;
    listMarker?: string;
    listIsBullet?: boolean;
    listMarkerHidden?: boolean;
    listMarkerFontFamily?: string;
    listMarkerFontSize?: number;
    listMarkerSuffix?: 'tab' | 'space' | 'nothing';
    listMarkerRevision?: 'ins' | 'del';
    defaultTabStopTwips?: number;
    defaultFontSize?: number;
    defaultFontFamily?: string;
    suppressEmptyParagraphHeight?: boolean;
    pPrIns?: RevisionInfo | null;
    pPrDel?: RevisionInfo | null;
};

// @public
export type ParagraphBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'paragraph';
    id: BlockId;
    runs: Run[];
    attrs?: ParagraphAttrs;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type ParagraphBorders = {
    top?: BorderStyle;
    bottom?: BorderStyle;
    left?: BorderStyle;
    right?: BorderStyle;
    between?: BorderStyle;
    bar?: BorderStyle;
};

// @public
export type ParagraphFragment = FragmentBase & {
    kind: 'paragraph';
    fromLine: number;
    toLine: number;
    height: number;
    continuesFromPrev?: boolean;
    continuesOnNext?: boolean;
};

// @public
export type ParagraphIndent = {
    left?: number;
    right?: number;
    firstLine?: number;
    hanging?: number;
};

// @public
export type ParagraphMeasure = {
    kind: 'paragraph';
    lines: MeasuredLine[];
    totalHeight: number;
};

// @public
export type ParagraphSpacing = {
    before?: number;
    after?: number;
    line?: number;
    lineUnit?: 'px' | 'multiplier';
    lineRule?: 'auto' | 'exact' | 'atLeast';
};

// @public
export type Run = TextRun | TabRun | ImageRun | LineBreakRun | FieldRun;

// @public
export type RunFormatting = {
    bold?: boolean;
    italic?: boolean;
    underline?: boolean | {
        style?: string;
        color?: string;
    };
    strike?: boolean;
    color?: string;
    highlight?: string;
    fontFamily?: string;
    fontSize?: number;
    letterSpacing?: number;
    superscript?: boolean;
    subscript?: boolean;
    allCaps?: boolean;
    smallCaps?: boolean;
    positionPx?: number;
    horizontalScale?: number;
    kerningMinPt?: number;
    imprint?: boolean;
    emboss?: boolean;
    textShadow?: boolean;
    textOutline?: boolean;
    emphasisMark?: 'dot' | 'comma' | 'circle' | 'underDot';
    hidden?: boolean;
    rtl?: boolean;
    textEffect?: 'blinkBackground' | 'lights' | 'antsBlack' | 'antsRed' | 'shimmer' | 'sparkle';
    hyperlink?: HyperlinkInfo;
    footnoteRefId?: number;
    endnoteRefId?: number;
    commentIds?: number[];
    isInsertion?: boolean;
    isDeletion?: boolean;
    changeAuthor?: string;
    changeDate?: string;
    changeRevisionId?: number;
};

// @public
export function scheduleSectionBreak(block: SectionBreakBlock, state: SectionState, _baseMargins: PageMargins): {
    decision: BreakDecision;
    state: SectionState;
};

// @public
export interface SdtGroup {
    // (undocumented)
    alias?: string;
    // (undocumented)
    bound?: boolean;
    // (undocumented)
    checked?: boolean;
    // (undocumented)
    id: string;
    // (undocumented)
    lock?: string;
    // (undocumented)
    repeatingItem?: boolean;
    // (undocumented)
    sdtType: string;
    // (undocumented)
    tag?: string;
}

// @public
export type SectionBreakBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'sectionBreak';
    id: BlockId;
    type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
    pageSize?: {
        w: number;
        h: number;
    };
    orientation?: 'portrait' | 'landscape';
    margins?: PageMargins;
    columns?: ColumnLayout;
};

// @public
export type SectionBreakMeasure = {
    kind: 'sectionBreak';
};

// @public
export type SectionLayoutConfig = {
    pageSize: {
        w: number;
        h: number;
    };
    margins: PageMargins;
    columns?: ColumnLayout;
};

// @public
export type SectionState = {
    activeTopMargin: number;
    activeBottomMargin: number;
    activeLeftMargin: number;
    activeRightMargin: number;
    pendingTopMargin: number | null;
    pendingBottomMargin: number | null;
    pendingLeftMargin: number | null;
    pendingRightMargin: number | null;
    activePageSize: {
        w: number;
        h: number;
    };
    pendingPageSize: {
        w: number;
        h: number;
    } | null;
    activeColumns: ColumnLayout;
    pendingColumns: ColumnLayout | null;
    activeOrientation: 'portrait' | 'landscape' | null;
    pendingOrientation: 'portrait' | 'landscape' | null;
    hasAnyPages: boolean;
};

// @public
export type TabAlignment = 'start' | 'end' | 'center' | 'decimal' | 'bar' | 'clear';

// @public
export type TableBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'table';
    id: BlockId;
    rows: TableRow[];
    columnWidths?: number[];
    width?: number;
    widthType?: string;
    justification?: 'left' | 'center' | 'right';
    indent?: number;
    floating?: FloatingTablePosition;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type TableCell = {
    id: BlockId;
    blocks: FlowBlock[];
    colSpan?: number;
    rowSpan?: number;
    width?: number;
    widthValue?: number;
    widthType?: string;
    verticalAlign?: 'top' | 'center' | 'bottom';
    background?: string;
    borders?: CellBorders;
    padding?: {
        top: number;
        right: number;
        bottom: number;
        left: number;
    };
    noWrap?: boolean;
    trackedMarker?: CellMarker;
};

// @public
export type TableCellMeasure = {
    blocks: Measure[];
    width: number;
    height: number;
    colSpan?: number;
    rowSpan?: number;
};

// @public
export type TableFragment = FragmentBase & {
    kind: 'table';
    fromRow: number;
    toRow: number;
    height: number;
    isFloating?: boolean;
    continuesFromPrev?: boolean;
    continuesOnNext?: boolean;
    headerRowCount?: number;
    topClip?: number;
    bottomClip?: number;
};

// @public
export type TableMeasure = {
    kind: 'table';
    rows: TableRowMeasure[];
    columnWidths: number[];
    totalWidth: number;
    totalHeight: number;
};

// @public
export type TableRow = {
    id: BlockId;
    cells: TableCell[];
    height?: number;
    heightRule?: 'auto' | 'atLeast' | 'exact';
    isHeader?: boolean;
    cantSplit?: boolean;
    trackedIns?: RevisionInfo;
    trackedDel?: RevisionInfo;
};

// @public
export type TableRowMeasure = {
    cells: TableCellMeasure[];
    height: number;
};

// @public
export type TabRun = RunFormatting & {
    kind: 'tab';
    width?: number;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type TabStop = {
    val: TabAlignment;
    pos: number;
    leader?: 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
};

// @public
export type TextBoxBlock = {
    sdtGroups?: SdtGroup[];
    kind: 'textBox';
    id: BlockId;
    width: number;
    height?: number;
    fillColor?: string;
    outlineWidth?: number;
    outlineColor?: string;
    outlineStyle?: string;
    margins?: {
        top: number;
        bottom: number;
        left: number;
        right: number;
    };
    content: ParagraphBlock[];
    displayMode?: 'inline' | 'float' | 'block';
    cssFloat?: 'left' | 'right' | 'none';
    wrapType?: string;
    wrapText?: WrapTextDirection;
    anchorTarget?: 'followingBlock';
    position?: ImageRunPosition;
    distTop?: number;
    distBottom?: number;
    distLeft?: number;
    distRight?: number;
    pmStart?: number;
    pmEnd?: number;
};

// @public
export type TextBoxFlowAttrs = Pick<TextBoxBlock, 'displayMode' | 'wrapType'>;

// @public
export type TextBoxFragment = FragmentBase & {
    kind: 'textBox';
    height: number;
    isFloating?: boolean;
    zIndex?: number;
};

// @public
export type TextBoxMeasure = {
    kind: 'textBox';
    width: number;
    height: number;
    innerMeasures: ParagraphMeasure[];
};

// @public
export type TextRun = RunFormatting & {
    kind: 'text';
    text: string;
    hyperlink?: HyperlinkInfo;
    pmStart?: number;
    pmEnd?: number;
    inlineSdtWidget?: InlineSdtWidget;
};

// @public
export function wrapsAroundText(wrapType: string | undefined): boolean;

// @public (undocumented)
export type WrapTextDirection = 'bothSides' | 'left' | 'right' | 'largest';

```
