declare const brand: unique symbol; type Brand = T & { readonly [brand]: B; }; export type Space = "page" | "viewport" | "image" | "capture"; /** css are logical pixels, device are physical pixels, usually equal to * */ export type Unit = "css" | "device"; type MainAxis = "x" | "y"; type InverseAxis = "x-inverse" | "y-inverse"; type Axis = MainAxis | InverseAxis; export type Coord = Brand; export type Length = Brand; export type Point = Readonly<{ top: Coord; left: Coord; }>; export type Size = Readonly<{ width: Length; height: Length; }>; export type Rect = Point & Size; export type YBand = { top: Coord; height: Length; }; export type XBand = { left: Coord; width: Length; }; export declare const getSize: (rect: Rect) => Readonly<{ width: Length; height: Length; }>; export declare const addCoords: >(a: T, b: T) => T; export declare const subtractCoords: >(a: T, b: T) => T; export declare const equalsSize: ; height: Length; }>>(a: T, b: T) => boolean; export declare const prettyPoint: ; left: Coord; }>>(point: T) => string; export declare const prettySize: ; height: Length; }>>(size: T) => string; export declare const prettyRect: >(rect: T) => string; export declare const intersectYBands: >(a: T | null, b: T | null) => T | null; export declare const intersectXBands: >(a: T | null, b: T | null) => T | null; export declare const getIntersection: | YBand | XBand, B extends Rect | YBand | XBand>(a: A | null, b: B | null) => (A & B) | null; type GetUnit = T extends Coord ? Unit : never; type GetAxis = T extends Coord ? Axis : never; export declare const getHeight: >(a: T, b: T) => Length, GetAxis>; export declare const getWidth: >(a: T, b: T) => Length, GetAxis>; export declare const getBottom: (bandOrRect: YBand) => Coord; export declare const getRight: (bandOrRect: XBand) => Coord; export declare const getMaxLength: (...lengths: Length[]) => Length; export declare const getMaxCoord: >(...coords: T[]) => T; export declare const getMinCoord: >(...coords: T[]) => T; export declare const fromCaptureAreaToViewport: (coordRelativeToCaptureArea: Coord<"capture", U, "y">, captureAreaTopRelativeToViewport: Coord<"viewport", U, "y">) => Coord<"viewport", U, "y">; export declare const fromViewportToCaptureArea: (coordRelativeToViewport: Coord<"viewport", U, "y">, captureAreaTopRelativeToViewport: Coord<"viewport", U, "y">) => Coord<"capture", U, "y">; export declare const getCoveringRect: >(rects: T[]) => T; type NumericShape = Rect | YBand | XBand | Size | Point; export declare const roundCoords: (value: T) => T; export declare const floorCoords: (value: T) => T; export declare const ceilCoords: (value: T) => T; type CssToDevice = T extends Rect ? Rect : T extends YBand ? YBand : T extends XBand ? XBand : T extends Size<"css"> ? Size<"device"> : T extends Point ? Point : never; export declare const fromCssToDevice: ; height: Length<"css", "y">; }> | Readonly<{ top: Coord; left: Coord; }> | Rect | YBand | XBand>(value: T, pixelRatio: number) => CssToDevice; export declare const fromCssToDeviceNumber: { (value: Coord, pixelRatio: number): Coord; (value: Length, pixelRatio: number): Length<"device", A>; }; export declare const fromDeviceToCssNumber: { (value: Coord, pixelRatio: number): Coord; (value: Length, pixelRatio: number): Length<"css", A>; }; export declare const fromBcrToRect: (bcr: DOMRect) => Rect<"viewport", "css">; export {};