import type { PPTTextElement, Slide, TextAlignVertical, TextInset } from '../types/slides'; export { elementLocksTextBox, shapeTextLocksSize, textElementLocksSize } from './textBoxLock'; export interface PlaceholderBoxMetrics { placeholderFontSize?: number; lineHeight?: number; inset?: TextInset; /** Lines of placeholder-sized text the box should fit (default 1). */ lines?: number; paragraphSpace?: number; } /** * Minimum box height from placeholder typography: vertical inset + text lines at * placeholderFontSize × lineHeight (+ paragraph gaps between lines). */ export declare const computePlaceholderMinBoxHeight: (metrics?: PlaceholderBoxMetrics) => number; /** * Empty-slot height: the larger of the quiet prompt and the typed default. * Used only while the placeholder is empty. Filled auto-height hugs the text. */ export declare const computePlaceholderSlotHeight: (el: Pick & { lines?: number; }) => number; /** Fixed slot height: the larger of the two paints, never smaller than a stored layout height. */ export declare const getPlaceholderBaselineHeight: (el: PPTTextElement) => number; export declare const isPlaceholderElement: (el: PPTTextElement) => boolean; /** Title placeholder on content slides (slide 2+): left-aligned, vertically centered in the layout box. */ export declare const isContentSlideTitlePlaceholder: (el: PPTTextElement, slideType?: Slide['type']) => boolean; export interface TextBoxLayout { fixedHeight: boolean; vAlign: TextAlignVertical; /** Flex-column vertical centering without locking box height (content slides title). */ flexCenterInLayoutBox: boolean; /** Empty placeholder slot (dashed prompt). */ emptyPlaceholder: boolean; /** * Auto-height paint floored at the committed height (empty placeholder * slots, filled content-slide titles): `height: auto` + `min-height`. The * box grows with the text the same frame the text grows — no clip, and the * painted box never lags behind its glyphs. */ slotFlooredAuto: boolean; /** Flex-column paint: fixed boxes, empty slots, centered layout titles. */ flexColumn: boolean; /** Definite px `height` paint: explicit fixed-height boxes only. */ lockPaintHeight: boolean; } export declare const V_ALIGN_JUSTIFY: { readonly top: 'flex-start'; readonly middle: 'center'; readonly bottom: 'flex-end'; }; export declare const resolveTextBoxLayout: (el: PPTTextElement, slideType?: Slide['type'], contentEmpty?: boolean) => TextBoxLayout; /** * Live paint mode. `fit` shrinks type; `grow` grows the box; `slot` is the * empty dashed placeholder (definite height, no shrink-to-fit). */ export type TextBoxLiveMode = 'grow' | 'fit' | 'slot'; export declare const textBoxLiveMode: (el: Pick, layout: TextBoxLayout) => TextBoxLiveMode; /** Painted size for unmarked runs. Placeholder/title slots use the typed size, not 16. */ export declare const authoredTextFitSize: (el: Pick) => number; export declare const textBoxPaintSize: (el: PPTTextElement, layout: TextBoxLayout) => { width: string; height: string; minHeight: string; }; export declare const textBoxFlexColumn: (layout: TextBoxLayout) => boolean; export declare const textBoxJustify: (layout: TextBoxLayout) => "center" | "flex-end" | "flex-start"; /** * The ONE rule for auto-height commits: the box tracks its text but never * shrinks below its slot floor. Empty slots keep the dashed frame, filled * content-slide titles keep their centered layout slot, every other filled * box hugs the text. The floor never exceeds the current height, so an * already-short slot is never surprise-grown. Returns null when the store * height must not change. */ export declare const textBoxAutoHeight: (el: PPTTextElement, layout: TextBoxLayout, measuredTextHeight: number) => number | null; /** Slot floor for drag-time height measurements (store content, no live editor state). */ export declare const placeholderHeightFloor: (el: PPTTextElement, slideType?: Slide['type']) => number; /** * Fixed mode restores a placeholder to its slot: its "fixed size" is the * designed slot, not whatever the text last hugged. */ export declare const placeholderFixedRestoreHeight: (el: PPTTextElement) => number;