animouse
Version:
lightweight animation state machine for three js
42 lines (41 loc) • 1.75 kB
TypeScript
/**
* Asserts that a number is valid (finite and within safe integer range).
*
* @param value - The number to validate
* @param subject - Custom error message for validation failure
* @throws {Error} When the value is not finite or exceeds MAX_SAFE_INTEGER
*/
export declare function assertValidNumber(value: number, subject: string): void;
/**
* Asserts that an azimuth angle is valid (finite and between 0 and 2π).
*
* @param value - The azimuth angle in radians to validate
* @param subject - Custom error message for validation failure
* @throws {Error} When the value is not finite or is not between 0 and 2π radians
*/
export declare function assertValidAzimuth(value: number, subject: string): void;
/**
* Asserts that a number is within the unit range [0, 1].
*
* @param value - The number to validate
* @param subject - Custom error message for validation failure
* @throws {Error} When the value is not within the range [0, 1]
*/
export declare function assertValidUnitRange(value: number, subject: string): void;
/**
* Asserts that a number is positive (greater than EPSILON).
* Uses EPSILON to account for floating-point precision errors.
*
* @param value - The number to validate
* @param subject - Custom error message for validation failure
* @throws {Error} When the value is less than EPSILON
*/
export declare function assertValidPositiveNumber(value: number, subject: string): void;
/**
* Asserts that a number is non-negative (greater than or equal to 0).
*
* @param value - The number to validate
* @param subject - Custom error message for validation failure
* @throws {Error} When the value is negative
*/
export declare function assertValidNonNegativeNumber(value: number, subject: string): void;