import type { Copy, Debug, Display } from '@chzky/core'; export interface RangeBounds extends Copy, Debug, Display { /** ### `accuracy` : 迭代精度 , 默认为`1` */ readonly accuracy: number; /** ### `start` : 起始值 */ readonly start: number; /** ### `end` : 结束值 */ readonly end: number; /** ### `contains` : 包含值判定 @example ```ts Range(0, 11).contains(5) // true ``` */ contains(data: number): boolean; /** ### `sample` : 从范围内选取一个随机值 + 随机值的精确度由 `accuracy` 决定 @example ```ts const data = Range(20, 100, 0.2).sample() assert(data >= 20 && data < 100) ``` */ sample(): number; } /** ## `RangeInclusive` : 闭区间(closed range)类型 + 表示 左闭右闭 的范围 :`[start, end]` */ export interface RangeInclusive extends RangeBounds { } /** ## `RangeTo` : 左极右开区间(half-open range)类型 + 表示 左闭右开 的范围 :`(-∞, b)` */ export interface RangeTo extends RangeBounds { } /** ## `RangeToInclusive` : 左极右闭区间(closed range)类型 + 表示 左闭右闭 的范围 :`(-∞, b]` */ export interface RangeToInclusive extends RangeBounds { } /** ## `RangeFrom` : 右极左开区间(half-open range)类型 + 表示 左闭右开 的范围 :`[a, +∞)` */ export interface RangeFrom extends RangeBounds { } /** ## `RangeFull` : 全区间(full range)类型 + 表示 左闭右开 的范围 :`(-∞, +∞)` */ export interface RangeFull extends RangeBounds { } //# sourceMappingURL=interface.d.ts.map