23 lines
681 B
TypeScript
23 lines
681 B
TypeScript
interface LengthObject {
|
|
value: number;
|
|
unit: string;
|
|
}
|
|
/**
|
|
* If size is a number, append px to the value as default unit.
|
|
* If size is a string, validate against list of valid units.
|
|
* If unit is valid, return size as is.
|
|
* If unit is invalid, console warn issue, replace with px as the unit.
|
|
*
|
|
* @param {(number | string)} size
|
|
* @return {LengthObject} LengthObject
|
|
*/
|
|
export declare function parseLengthAndUnit(size: number | string): LengthObject;
|
|
/**
|
|
* Take value as an input and return valid css value
|
|
*
|
|
* @param {(number | string)} value
|
|
* @return {string} valid css value
|
|
*/
|
|
export declare function cssValue(value: number | string): string;
|
|
export {};
|