/** * Value Utilities * * Common utility functions for working with different value types. * * @fileoverview Value manipulation utilities * @version 1.0.0 */ export declare function isTruthy(value: unknown): boolean; export declare function toBoolean(value: unknown, defaultValue?: boolean): boolean; /** * Safely converts a value to a number. * Handles bigint, string, and number types. * * @param value - Value to convert (bigint, number, or string) * @param defaultValue - Default if conversion fails (default: 0) * @returns Number representation * * @example * ```typescript * toNumber(42) // 42 * toNumber(BigInt(100)) // 100 * toNumber('123') // 123 * toNumber('invalid') // 0 (default) * toNumber('invalid', -1) // -1 (custom default) * ``` */ export declare function toNumber(value: bigint | number | string | unknown, defaultValue?: number): number; /** * Value validation and conversion utilities. */ export declare const ValueUtils: { /** * Checks if a value is a valid percentage (0-100). * * @param value - Value to check * @returns true if valid percentage */ readonly isValidPercentage: (value: unknown) => boolean; /** * Clamps a number to a specific range. * * @param value - Value to clamp * @param min - Minimum value * @param max - Maximum value * @returns Clamped value */ readonly clamp: (value: number, min: number, max: number) => number; /** * Checks if a value is empty (null, undefined, empty string, empty array). * * @param value - Value to check * @returns true if empty */ readonly isEmpty: (value: unknown) => boolean; /** * Safely gets a nested property from an object. * * @param obj - Object to query * @param path - Dot-separated path (e.g., 'user.profile.name') * @param defaultValue - Default if path doesn't exist * @returns Property value or default */ readonly getNestedProperty: (obj: unknown, path: string, defaultValue?: unknown) => unknown; }; //# sourceMappingURL=values.d.ts.map