import { DrawingBlock, DrawingMeasure } from '../../contracts/src/index.js';
import { NormalizedColumns } from './layout-image.js';
import { PageState } from './paginator.js';
/**
 * Context for laying out a drawing block (vector shape) within the page layout.
 *
 * Drawings are vector-based graphical objects (shapes, diagrams, etc.) that can be
 * positioned inline or anchored. This context provides all necessary information and
 * callbacks for positioning the drawing fragment on the current page/column.
 */
export type DrawingLayoutContext = {
    /** The drawing block to layout */
    block: DrawingBlock;
    /** Measured dimensions and geometry data for the drawing */
    measure: DrawingMeasure;
    /** Normalized column configuration (width, gap, count) for the current layout */
    columns: NormalizedColumns;
    /** Ensures a page exists and returns the current page state */
    ensurePage: () => PageState;
    /** Advances to the next column or page, returning the new page state */
    advanceColumn: (state: PageState) => PageState;
    /** Computes the X coordinate for a given column index */
    columnX: (columnIndex: number) => number;
};
/**
 * Layout a drawing block (vector shape) within the document flow.
 *
 * This function handles inline/block-level vector shapes (rectangles, circles, etc.),
 * positioning them on the page with proper scaling and margin handling. Anchored
 * drawings (positioned objects) are skipped and handled separately via the anchoring
 * system.
 *
 * Algorithm:
 * 1. Skip anchored drawings (handled by anchor system)
 * 2. Apply margins and scale drawing to fit within column width
 * 3. Scale down if drawing exceeds page content height
 * 4. Advance column/page if drawing doesn't fit at current cursor position
 * 5. Create DrawingFragment with final position and dimensions
 * 6. Push fragment to page and advance cursor
 *
 * @param context - Layout context containing block, measure, and layout callbacks
 *
 * @remarks
 * **Side Effects:**
 * - Mutates page state via `ensurePage()` and `advanceColumn()`
 * - Pushes DrawingFragment to `state.page.fragments`
 * - Advances `state.cursorY` by the drawing's total height (including margins)
 *
 * **Scaling Behavior:**
 * - Width is constrained to fit within column width (minus margins)
 * - Height is constrained to fit within page content height
 * - Aspect ratio is preserved during scaling
 *
 * **Anchored Drawings:**
 * - Anchored drawings (`block.anchor?.isAnchored === true`) are skipped
 * - They are positioned via the paragraph anchoring pre-pass
 */
export declare function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn, columnX, }: DrawingLayoutContext): void;
//# sourceMappingURL=layout-drawing.d.ts.map