/** * Read an image's pixel dimensions from its header bytes. * * Needed because the hotspot/crop model is resolution-independent but not *aspect*-independent: * fitting a 16:9 frame inside a crop requires knowing the source's real proportions, and a * normalised crop rectangle alone cannot supply them. * * Header parsing rather than a decoder: dimensions live in the first few dozen bytes of every * format here, so there is nothing to gain from decoding pixels and a native dependency to avoid. * `sharp` and `image-size`'s native paths are both ruled out by the zero-native-dependency rule, * and this runs identically in Node and on Workers. * * Returns `null` for anything it does not recognise — an unknown format is not an error, it just * means the crop editor falls back to the browser's own idea of the aspect ratio. */ export interface ImageDimensions { width: number; height: number; } export declare function readImageDimensions(bytes: Uint8Array): ImageDimensions | null;