import { type Result } from '../result/result.js'; import { CoercionError } from '../utils/errors.js'; /** * Coerce a value to a number. * Handles strings, booleans, and Date objects. * * @example * ```ts * toNumber("42") // Ok(42) * toNumber("abc") // Err(CoercionError) * toNumber(true) // Ok(1) * toNumber(null) // Err(CoercionError) * ``` */ export declare function toNumber(value: unknown): Result; /** * Coerce a value to a string. * Handles numbers, booleans, null, undefined, and objects. * * @example * ```ts * toString(42) // "42" * toString(null) // "" * toString(undefined) // "" * toString(true) // "true" * ``` */ export declare function toString(value: unknown): string; /** * Coerce a value to a boolean. * Handles common truthy/falsy string representations. * * @example * ```ts * toBoolean("true") // true * toBoolean("yes") // true * toBoolean("1") // true * toBoolean("false") // false * toBoolean("no") // false * toBoolean("0") // false * toBoolean(1) // true * toBoolean(0) // false * ``` */ export declare function toBoolean(value: unknown): boolean; /** * Coerce a value to a Date. * * @example * ```ts * toDate("2024-01-15") // Ok(Date) * toDate(1705276800000) // Ok(Date) * toDate("not-a-date") // Err(CoercionError) * ``` */ export declare function toDate(value: unknown): Result; /** * Wrap a non-array value in an array. Arrays are returned as-is. * * @example * ```ts * toArray(42) // [42] * toArray([1, 2]) // [1, 2] * toArray(null) // [] * toArray(undefined)// [] * ``` */ export declare function toArray(value: T | T[] | null | undefined): T[]; /** * Coerce a value to an integer. */ export declare function toInteger(value: unknown): Result; //# sourceMappingURL=coerce.d.ts.map