@drozdik.m/dimensions-ratio
Version:
Simple helper for setting dimensions using ratio parameters.
36 lines (35 loc) • 1.24 kB
TypeScript
export declare class DimensionsRatio {
private dimensionsHelper;
private element;
/**
* Creates active container for providing
* @param element
*/
constructor(element: HTMLElement);
/**
* Sets height of the element by given ratio and its width
* @param widthRatio Width ratio
* @param heightRatio Height ratio
*/
ByWidth(widthRatio: number, heightRatio: number): void;
/**
* Sets width of the element by given ratio and its height
* @param widthRatio Width ratio
* @param heightRatio Height ratio
*/
ByHeight(widthRatio: number, heightRatio: number): void;
/**
* Sets height of the element by given ratio and its width
* @param element Target element
* @param widthRatio Width ratio
* @param heightRatio Height ratio
*/
static ByWidth(element: HTMLElement, widthRatio: number, heightRatio: number): void;
/**
* Sets width of the element by given ratio and its height
* @param element Target element
* @param widthRatio Width ratio
* @param heightRatio Height ratio
*/
static ByHeight(element: HTMLElement, widthRatio: number, heightRatio: number): void;
}