import type { Fn } from '@chzky/core'; import type { Range } from '../../mod.js'; /** * ## `within` : 创建一个检查数值是否在指定范围内的函数 * - 返回一个函数,用于判断给定值是否在 `[start, end) `闭区间范围内 * @example * ```ts * const is_in_range = within(0, 100) * console.log(is_in_range(50)) // true * console.log(is_in_range(-1)) // false * console.log(is_in_range(101)) // false * console.log(is_in_range(100) // false * console.log(within(Range(0, 100))(50)) // true * ``` * @example * ```ts *const validateCelsius = pipe( * (f: number) => (f - 32) * 5/9, // 华氏度转摄氏度 * within(-273.15, 100) // 检查是否在有效的摄氏度范围内 *) * *console.log(validateCelsius(32)) // true (0°C) *``` * @category Math */ export declare function within(range: Range): Fn; export declare function within(start: number, end: number): Fn; //# sourceMappingURL=within.d.ts.map