UNPKG

@rickosborne/rebound

Version:

Rick Osborne's utilities for working with bounded numbers

11 lines 1.11 kB
import type { GuardExact, GuardIfPresent, If, IfIfPresent } from "./guard-bounded.js"; import type { OutOfBoundsErrorProvider, TypedCheckedBounds } from "./spec.js"; export interface AssertExact<N extends number> extends TypedCheckedBounds { (this: void, value: unknown, name?: string | undefined): asserts value is N; } export interface AssertIfPresent<N extends number> extends TypedCheckedBounds { (this: void, value: unknown, name?: string | undefined): asserts value is N | null | undefined; } export declare function assertBounded<N extends number, IfPresent extends boolean>(guard: If<IfPresent, GuardIfPresent<N>, GuardExact<N>>, errorProvider: OutOfBoundsErrorProvider, ifPresent: IfPresent, value: unknown, name?: string | undefined): asserts value is IfIfPresent<IfPresent, N>; export declare function assertForBounds<N extends number, IfPresent extends boolean>(guard: If<IfPresent, GuardIfPresent<N>, GuardExact<N>>, errorProvider: OutOfBoundsErrorProvider, ifPresent: IfPresent, fnName?: string): If<IfPresent, AssertIfPresent<N>, AssertExact<N>>; //# sourceMappingURL=assert-bounded.d.ts.map