import { type MapFunction } from '../value/map'; export interface NumberBound { /** * The minimum value. */ readonly min: T; /** * The maximum value, inclusive. */ readonly max: T; } /** * Checks whether a {@link NumberBound} is valid (min is less than or equal to max). * * @param bounds - The bounds to validate * @returns `true` if `min <= max` */ export declare function isValidNumberBound(bounds: NumberBound): boolean; export type IsInNumberBoundFunction = (number: number) => boolean; /** * Creates a function that checks whether a number falls within the specified inclusive bounds. * * @param bounds - The min/max bounds to test against * @returns A function that returns `true` if the input number is within bounds * @throws Error if the bounds are invalid (min > max) */ export declare function isInNumberBoundFunction(bounds: NumberBound): IsInNumberBoundFunction; export interface WrapNumberFunctionConfig extends NumberBound { /** * Whether or not to wrap to the nearest "fencepost" value instead of by direct index. * * False by default. */ readonly fencePosts?: boolean; } export type WrapNumberFunction = MapFunction & { readonly _wrap: WrapNumberFunctionConfig; }; /** * Creates a function that wraps numbers around within the specified bounds, like modular arithmetic. * * When `fencePosts` is true, wraps to the nearest "fence post" value, extending the wrap range by one in each direction. * * @param wrapNumberFunctionConfig - Configuration with min, max, and optional fence post behavior * @returns A function that wraps input numbers into the bounded range */ export declare function wrapNumberFunction(wrapNumberFunctionConfig: WrapNumberFunctionConfig): WrapNumberFunction; export interface BoundNumberFunctionConfig extends NumberBound { /** * Whether or not to "wrap" values around. * * Example: Wrapping from -180 to 180 */ readonly wrap?: boolean; } export type BoundNumberFunction = MapFunction; /** * Creates a function that constrains numbers within bounds, either by clamping or wrapping. * * When `wrap` is true, uses modular wrapping. Otherwise, clamps values to the min/max range. * * @param boundNumberFunctionConfig - Configuration with min, max, and optional wrap behavior * @returns A function that bounds input numbers into the configured range */ export declare function boundNumberFunction(boundNumberFunctionConfig: BoundNumberFunctionConfig): BoundNumberFunction; /** * Clamps the input number between the min and max values (inclusive). * * @param input - Number to clamp * @param min - Minimum allowed value * @param max - Maximum allowed value * @returns The clamped value */ export declare function boundNumber(input: number, min: T, max: T): T;