/** * Pure time↔pixel conversion utilities. * * Extracted so ruler, playhead, every lane, and every interaction handler * share a single formula. Drift between any two producers is the classic * timeline-editor bug; this module prevents it. */ export interface ViewportCoords { /** Current zoom level. */ pxPerSecond: number; /** Time (seconds) at x=0 in the lane area. */ scrollSec: number; /** Measured lane-area pixel width. */ containerWidth: number; /** Canonical doc duration (seconds). */ duration: number; } export declare const MIN_PX_PER_SEC = 4; export declare const MAX_PX_PER_SEC = 400; export declare function clampPxPerSec(v: number): number; /** * Clamp scrollSec so the viewport stays inside [0, duration]. If the viewport * is wider than the doc (zoomed way out), scrollSec is pinned to 0. */ export declare function clampScrollSec(s: number, duration: number, pxPerSec: number, containerWidth: number): number; export declare function timeToX(t: number, v: { pxPerSecond: number; scrollSec: number; }): number; export declare function xToTime(x: number, v: { pxPerSecond: number; scrollSec: number; }): number; /** * Zoom by `factor` while keeping `cursorX` pinned to the same time. * factor > 1 zooms in, factor < 1 zooms out. */ export declare function zoomAtCursor(v: ViewportCoords, factor: number, cursorX: number): { pxPerSecond: number; scrollSec: number; }; /** * Fit the full duration into the lane area. If container not yet measured, * returns MIN_PX_PER_SEC as a safe default. */ export declare function fitViewport(duration: number, containerWidth: number): { pxPerSecond: number; scrollSec: number; }; //# sourceMappingURL=coords.d.ts.map