UNPKG

@wordpress/components

Version:
53 lines • 1.53 kB
/** * Parses and retrieves a number value. * * @param value The incoming value. * * @return The parsed number value. */ export declare function getNumber(value: unknown): number; /** * Safely adds values together, handling floating-point precision issues. * * @param args Values to add together. * * @return The sum of values. */ export declare function add(...args: Array<number | string>): number; /** * Safely subtracts values, handling floating-point precision issues. * * @param args Values to subtract together. * * @return The difference of the values. */ export declare function subtract(...args: Array<number | string>): number; /** * Safely multiplies values together, handling floating-point precision issues. * * @param args Values to multiply together. * * @return The product of values. */ export declare function multiply(...args: Array<number | string>): number; /** * Clamps a value based on a min/max range. * * @param value The value. * @param min The minimum range. * @param max The maximum range. * * @return The clamped value. */ export declare function clamp(value: number | string, min: number, max: number): number; /** * Rounds a value to the nearest step offset by a minimum. * * @param value The value. * @param min The minimum range. * @param step The increment for the value. * * @return The value as a valid step. */ export declare function ensureValidStep(value: number | string, min: number, step: number): number; //# sourceMappingURL=math.d.ts.map