@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
19 lines (18 loc) • 758 B
TypeScript
export declare class ImageDimension {
/**
* Calculate aspect ratio of element.
* @param el
* @returns number
*/
static GetAspect(el: Element): number;
/**
* Calculates the aspect ratio of an image from a given URL.
*
* @param {string} src - The source URL of the image.
* @returns {Promise<number>} A promise that resolves with the aspect ratio of the image.
* The aspect ratio is calculated as (width / height) and
* rounded to two decimal places. If the image fails to load
* or the dimensions are not available, the promise is rejected.
*/
static GetAspectByUrl(src: string): Promise<number>;
}