@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
17 lines (16 loc) • 599 B
TypeScript
/**
* Common function that returns coefficient aspect ratio
* Supported formats: w:h, w/h, coefficient
* @example
* `16:9`, `16/9`, `1.77`
* @param str - string to parse
* @returns aspect ratio coefficient
*/
export declare function parseAspectRatio(str: string): number;
/**
* Common parser for lazy attribute. Case insensitive. Note:
* - empty string or unknown values are treated as `auto`.
* - `null` (or non string objects) is treated as `none`.
* - `manual` or `none` are treated as it is
*/
export declare function parseLazyAttr(value: string | null): 'auto' | 'manual' | 'none';