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