/** * Checks if the provided value is a valid finite number, excluding NaN (Not-a-Number) * and infinite values (Infinity and -Infinity). * * This function performs a type check to ensure the value is of type `number` and * additionally verifies that it is finite and not NaN, which are special numeric values * representing invalid or infinite numbers. * * It serves as a type guard, narrowing the type of the input value to `number` if the check passes. * This is useful in TypeScript for ensuring type safety when dealing with potentially * untrusted or dynamically typed inputs, such as user inputs, API responses, or parsed data. * * @param value - The value to check. Can be of any type, but the function will only return true * for actual finite numbers. * @returns `true` if the value is a finite number and not NaN; otherwise, `false`. * When `true`, TypeScript will narrow the type of `value` to `number`. * * @example * ```typescript * console.log(isNumber(42)); // true * console.log(isNumber(3.14)); // true * console.log(isNumber(NaN)); // false * console.log(isNumber(Infinity)); // false * console.log(isNumber(-Infinity)); // false * console.log(isNumber('42')); // false * console.log(isNumber(null)); // false * console.log(isNumber(undefined)); // false * ``` * * @note This function does not consider numeric strings (e.g., "42") as numbers. * For parsing strings to numbers, consider using `parseFloat` or `parseInt` * in combination with this check. * @note This function rejects infinite values (Infinity/-Infinity) as they typically * represent error conditions or overflow in validation contexts. */ export declare function isNumber(value: unknown): value is number;