import type { RunSpec } from "@auto-hwp/editor-core"; import type { PageBox } from "../coords"; /** Page px per typographic point. own-render PAGE px = HWPUNIT/75 and 1pt = 100 HWPUNIT, so 1pt = 100/75 = * 4/3 page px (equivalently pt→px at 96dpi). A cell's on-screen font size is therefore * `size_pt × PAGE_PX_PER_PT × scale`, where `scale` = client px / page px (rendered / viewBox). */ export declare const PAGE_PX_PER_PT: number; /** The absolutely-positioned box + font size that make the editor sit EXACTLY over the cell rect (issue * 032 — the position/size error < 4px is measured against this). PURE: page-px rect × scale → client px, * and size_pt → client px. Node-testable with no DOM (this is the unit-tested core of the positioning). */ export interface InPlaceEditorStyle { left: number; top: number; width: number; /** The editor is at LEAST the cell height and grows DOWN when the text overflows (auto-height). */ minHeight: number; /** undefined when the run size is unknown → the editor inherits the sheet's default size. */ fontSize?: number; } /** Compute the editor's on-screen box + font size from the cell's page-px rect, the page scale, and the * cell's first-run size in points. Single source of the positioning math (unit-tested). */ export declare function computeInPlaceEditorStyle(box: PageBox, scale: number, fontSizePt?: number): InPlaceEditorStyle; export interface InPlaceCellEditorProps { /** The target cell/paragraph box in own-render PAGE px (the editor covers exactly this rect). */ box: PageBox; /** rendered px / viewBox px for the page (page px × scale = client px) — the SAME scale the SelectionOverlay * uses, so the editor tracks zoom/scroll with the cell. It also drives the run→span font-size render. */ scale: number; /** The target's CURRENT styled runs (issue 040) — rendered into the contentEditable so existing per-run * formatting shows live and round-trips. A multi-paragraph cell joins paragraphs with a bare `{text:"\n"}` * run (the shape `runsAt` returns). */ initialRuns: RunSpec[]; /** The cell's FIRST run size in points (issue 032: font-size = size_pt × scale). Read via the 027 * blockRuns path (`runsAt` → `firstRunStyle`). Omitted → the editor uses the sheet default. */ fontSizePt?: number; /** Fired with the serialized RUNS on commit (Enter / blur). The host commits them run-preserving via * SetTableCellRuns/SetParagraphRuns (issue 040 교훈 6). May return a Promise that REJECTS on failure; the * editor then un-latches so the user can retry (step 2). */ onCommit: (runs: RunSpec[]) => void | Promise; /** Fired on cancel (Esc). */ onCancel: () => void; /** OPTIONAL (issue 036): Tab / Shift+Tab inside a CELL editor = commit THEN move to the right/left cell * and re-enter edit. The host commits (run-preserving) and, ONLY on a successful commit, navigates + * re-opens the editor. Like `onCommit` it may REJECT (commit failed) → the editor un-latches and stays * open with the move CANCELLED (031 apply-verify spirit). Omitted (e.g. a paragraph editor) → Tab is the * default. IME-safe: never fires mid Korean composition. */ onCommitMove?: (dir: "left" | "right", runs: RunSpec[]) => void | Promise; } export declare function InPlaceCellEditor({ box, scale, initialRuns, fontSizePt, onCommit, onCancel, onCommitMove }: InPlaceCellEditorProps): import("react").JSX.Element; //# sourceMappingURL=InPlaceCellEditor.d.ts.map