/** CSS `translate(x, y) scale(scale)` with `transform-origin: 0 0`. */ export interface PanZoomTransform { x: number; y: number; scale: number; } export interface Point { x: number; y: number; } export interface Size { width: number; height: number; } /** A box in the viewport's own coordinates, before any transform. */ export interface Box { left: number; top: number; width: number; height: number; } export declare const IDENTITY: PanZoomTransform; /** Below this, a scale counts as the fitted one. */ export declare const EPSILON = 0.001; /** Scales to `scale` while the content point under `focus` stays where it is on screen. */ export declare function zoomAt(transform: PanZoomTransform, scale: number, focus: Point): PanZoomTransform; /** Larger than the viewport on an axis, its edges stay outside the viewport's; smaller, it is centred. */ export declare function clampTransform(transform: PanZoomTransform, viewport: Size, content: Box): PanZoomTransform; /** * At the fitted size the layout has centred the content already. Centring it again from measured * rects only adds their rounding: Chromium left 1/128 px, which counted as zoomed. */ export declare function settleTransform(transform: PanZoomTransform, viewport: Size, content: Box): PanZoomTransform; /** Whether the content is larger than the viewport on either axis, so a drag can move it. */ export declare function canPan(scale: number, viewport: Size, content: Box): boolean;