import type { ViewBox } from '../core/types/viewer'; export type FrameBounds = { width: number; height: number; }; /** * The rectangle of `aspect` that a resize gesture from `before` to `after` * should produce. * * The edges that did not move between the two are the anchor: * * - a corner drag keeps the opposite corner and sizes the box by the pointer's * projection onto the aspect's diagonal, so both axes of the drag count and * the corner stays under the pointer as nearly as the lock allows — pulling * mostly sideways still shrinks or grows the frame, rather than the frame * holding its height and ignoring the hand; * - an edge drag keeps the opposite edge, derives the other dimension from the * aspect, and keeps the box centred on the axis the handle did not touch; * - no edge moved — a plain move — and the box is returned as it came. * * With `bounds`, the result is also kept inside the canvas without breaking * the lock: it is shifted back in where it merely hangs over an edge, and * shrunk towards its anchor where it is too large to fit. */ export declare const lockRectAspect: (before: ViewBox, after: ViewBox, aspect: number, bounds?: FrameBounds | null) => ViewBox; /** * Moves a box inside the canvas, and clamps each side to the canvas where the * box is larger than it. Used for plain moves, where the shape is already * right and only the position can be wrong. */ export declare const clampFrameToBounds: (box: ViewBox, bounds: FrameBounds) => ViewBox; /** * Applies one typed value to a frame without breaking the lock. * * Typing a width or a height is read as "this big, from the same top-left * corner", and the other dimension follows; typing x or y moves the frame. * Nothing is re-normalised afterwards, so the number typed is the number kept. */ export declare const applyFrameField: (box: ViewBox, field: "x" | "y" | "w" | "h", value: number, aspect: number) => ViewBox; /** * A frame to start a new keyframe from: the reference box shrunk about its * centre, so it reads as a distinct nested frame the author can take hold of * rather than a second outline on top of the first. */ export declare const nestedFrame: (reference: ViewBox, ratio?: number) => ViewBox;