/** * Measurement invocation for a single block — dispatches between plain/rich * text runs and the `mathDisplay` bypass path that skips text layout entirely. */ import type { ContentBlock } from '../parse/index.js'; import type { Resource, ResourceType } from '../types.js'; import type { ResolvedConfig, VDTBlock, ResolvedResourceBlock, VDTFigureLabel } from '../vdt.js'; import type { BlockStyle } from './styles.js'; import type { MeasuredBlock, MeasurementCache } from '../measure/index.js'; import { measureBlock } from '../measure/index.js'; import { renderMath } from '../math/index.js'; import { type TableRowMetrics, type TableSliceSpec } from './resourceLayout.js'; import type { ResourceNumberingMap } from './resourceNumbering.js'; import type { CaptionCitations } from './citations.js'; export interface MeasurementInput { vdtType: VDTBlock['type']; /** Offset of the Markdown body in the chapter file: a figure's labels * carry absolute offsets (#857). */ bodyOffset?: number; rawBlock: ContentBlock; contentBlock: ContentBlock; style: BlockStyle; measureMaxWidth: number; measureOptions: Parameters[4]; mathEnabled: boolean; useRich: boolean; cache?: MeasurementCache; /** Resolved config — needed to lay out resource blocks. */ resolved?: ResolvedConfig; /** All known resources — drives inline `:ref` resolution in captions. */ resources?: Resource[]; /** All resource types. */ resourceTypes?: ResourceType[]; /** Computed resource numbering map. */ resourceNumbering?: ResourceNumberingMap; /** The formatted citations of resource captions and notes (#529). */ captionCitations?: ReadonlyMap; /** For `resource` blocks: the resolved resource, its type, and number. */ resource?: Resource; resourceType?: ResourceType; resourceNumber?: string; /** Widest the figure's image may be set (`ResourceLayoutInput.maxBodyWidth`). */ maxBodyWidth?: number; /** Px a picture with a safe area is set taller (or shorter) * (`ResourceLayoutInput.bodyHeightDelta`). */ bodyHeightDelta?: number; /** A resource on a vertical page: set upright (`ResourceLayoutInput.upright`). */ upright?: { maxLength: number; }; /** An inline resource whose caption goes to the side column (#729, * `ResourceLayoutInput.captionAside`). */ captionAside?: { dx: number; width: number; alignBottom: boolean; }; /** A table: lay out only these rows (`ResourceLayoutInput.slice`, an * inline table split across columns, #634). */ tableSlice?: TableSliceSpec; } export interface MeasurementResult { measured: MeasuredBlock; mathDisplayRender?: ReturnType; /** Present for `resource` blocks: the resolved, measured resource embed. */ resourceBlock?: ResolvedResourceBlock; /** A table laid out in full: its row metrics, for slice planning. */ tableRows?: TableRowMetrics; /** Height of the caption band set beside the body (`captionAside`). */ asideHeight?: number; } /** The labels of a `:::figure` block (#854) as the VDT carries them * (`ResolvedResourceBlock.labels`), their offsets absolute in the * chapter file (`bodyOffset` added), with their stable id, their anchor * and the source of each character (#857); undefined when it has none. */ export declare function figureLabels(block: Pick, bodyOffset?: number): VDTFigureLabel[] | undefined; export declare function runMeasurement(input: MeasurementInput): MeasurementResult; //# sourceMappingURL=buildMeasurement.d.ts.map