import type { Distribution } from "./Distribution"; /** * Canonical endpoint stored on `[Meta].whereby`. Call sites still accept a * scalar (inclusive) via {@link InputBound}; `.whereby()` runs {@link toBound} so * adapters always see this shape — never a scalar/object union. */ export type Bound<$T> = { value: $T; exclusive: boolean; }; /** * What `.whereby({ min, max })` accepts: a scalar is inclusive, an object names * an endpoint policy. `exclusive` is required on the object form so that form * exists only to state one. */ export type InputBound<$T> = $T | Bound<$T>; /** * Collapse a call-site bound to the stored shape. A `Date` is a scalar here * (`isPlainObject` rejects it); only a `{ value, exclusive }` literal is * already canonical. */ export declare function toBound<$T>(input: InputBound<$T>): Bound<$T>; /** * Inclusive integer interval implied by a discrete Bound pair. Exclusive min is * `value + 1`, exclusive max is `value - 1` — the same unit the length/ * integer/bigint draws already use. Empty iff `min > max`. */ export declare function effectiveDiscrete(min: Bound, max: Bound): { min: number; max: number; }; export declare function effectiveDiscreteBigint(min: Bound, max: Bound): { min: bigint; max: bigint; }; export declare function assertNonemptyDiscrete(label: string, min: Bound, max: Bound): void; export declare function assertNonemptyDiscreteBigint(label: string, min: Bound, max: Bound): void; /** * Continuous emptiness: inverted bounds, a point range with either end * exclusive, or both ends exclusive with no float strictly between them. * Sampling still uses the closed interval and {@link constrainContinuous} steps * off an exclusive endpoint — this check is what makes that step always have * somewhere to land. */ export declare function assertNonemptyContinuous(label: string, min: Bound, max: Bound): void; /** * One ulp toward `toward` from `value`. Approximate, and enough to leave an * exclusive endpoint without rejection-looping a truncated distribution that * clamped onto it. */ export declare function towardInterior(value: number, toward: number): number; /** * After a closed-interval draw: if the result equals an exclusive endpoint, * step one ulp toward the interior. Does not resample — a truncated * distribution's mass on the bound would otherwise loop. */ export declare function constrainContinuous(next: () => number, min: Bound, max: Bound): () => number; export declare function epochBound(bound: Bound): Bound; /** * Call-site `length` for `string` and `array`: a bare number is an exact count, * and `{ max, min?, distribution? }` is a range. A scalar end is inclusive. */ export type InputLength = number | { max: InputBound; min?: InputBound | undefined; distribution?: Distribution | undefined; }; /** * Stored `length`: both ends are canonical {@link Bound}s. `distribution` is * present only when the caller set one, so a bare count and an unspecified * distribution stay off the stored object. */ export type Length = { min: Bound; max: Bound; distribution?: Distribution | undefined; }; /** * Array/string `length`: a bare number is an exact count (no distribution); an * omitted `min` is inclusive `0`. Always stored as a Bound pair so adapters * have one path. `distribution` is copied only when the caller set one, * matching `date/Registry.ts`'s `toWhereby`, so stored meta stays minimal. */ export declare function toLengthRange(length: InputLength, label: string): Length;