import type { Layout } from './options.js'; export interface Rect { x: number; y: number; width: number; height: number; } /** What the camera looks at, in world units (a page is 1 wide, the spine is at x = 0). */ export interface Framing { /** Fits the element when bleeding: the pages, plus any room the layout always needs. Takes input. */ box: Rect; /** Everything a turning page can reach. The canvas covers this (clipped to the document). */ view: Rect; /** Camera position over the floor; the view needn't be centred on it. */ eye: { x: number; y: number; }; distance: number; /** World width that a drag of `dragDistance` × this turns a page all the way over. */ dragWidth: number; /** Directional shadow frustum, already scaled to the page aspect. */ shadow: { left: number; right: number; top: number; bottom: number; }; } export declare function framingFor(layout: Layout, aspect: number): Framing; /** The plain view: just the pages, centred, with nothing around them. */ export declare function plainFramingFor(layout: Layout, aspect: number): Framing; export interface Fit { /** Pixels per world unit. */ scale: number; /** Where the whole view lands, in px relative to the root's top-left corner. */ view: Rect; /** Where the box lands, in px relative to the root. */ box: Rect; /** Height the root needs when its container has no height of its own. */ height: number; } /** * Fits the framing into an element. With `bleed`, the box fills the element and the rest * of the view spills past it; without, the whole view stays inside. An element with no * height (`height` 0) takes its height from its width. */ export declare function fit(framing: Framing, width: number, height: number, bleed: boolean): Fit;