interface GetSizeOptions { toFixed?: number; unit?: U; } declare class NOODLViewport { #private; width: number; height: number; /** * Returns an object with width and height, computed by apply the min/max values for the aspect ratio * @param { number | undefined } width - Defaults to window.innerWidth * @param { number | undefined } height - Defaults to window.innerHeight * @param { number } min - Minimum aspect ratio for width * @param { number } max - Maximum aspect ratio for height * @param { number } aspectRatio - Defaults to the aspect ratio of window.innerWidth and window.innerHeight */ static applyMinMax({ width, height, ...rest }: { width: number; height: number; min: number; max: number; aspectRatio: number; }): { width: number; height: number; }; /** * Returns the aspect ratio relative to the width and height. Defaults to window.innerWidth * and window.innerHeight * @param { number | undefined } width - Defaults to window.innerWidth * @param { number | undefined } height - Defaults to window.innerHeight */ static getAspectRatio(width: number, height: number): number; /** * Returns the computed size. * @param { string | number } value - Size in decimals as written in NOODL * @param { number } vpSize - The maximum width (or height) */ static getSize(value: string | number, vpSize: number, { toFixed, unit }?: GetSizeOptions): string | null | undefined; /** * Returns true if the value is considered an "invalid" data value to set on * a viewport's dimensions. This is mostly intended to trigger the auto-top * concept. Invalid values are: null, undefined, '', 'auto * @param { unknown } value */ static isNil(v: unknown, unit?: string): v is null | undefined | '' | 'auto'; /** * Returns true if the value is a NOODL value that the Viewport will treat as * "not yet transformed/parsed". The Viewport sees a NOODL value as a value * that is a string, does not have any letters, and is coercible to a number * @param { unknown } value */ static isNoodlUnit(v: unknown): v is string; /** https://tc39.es/ecma262/#sec-tonumber */ static toNum(v: unknown): number; constructor({ width, height }?: { width?: number; height?: number; }); isValid(): boolean; get onResize(): (viewport: { width: number; height: number; } & { previousWidth: number | undefined; previousHeight: number | undefined; }) => Promise | any; set onResize(callback: (viewport: { width: number; height: number; } & { previousWidth: number | undefined; previousHeight: number | undefined; }) => Promise | any); getWidth(dec: string, rest?: Parameters[2]): string | null | undefined; getHeight(dec: string, rest?: Parameters[2]): string | null | undefined; } export default NOODLViewport;