/** * Assertions that narrow the type of what they are given, for the invariants a * type cannot state. Each throws an `AssertError` when it does not hold. * * ```ts * assert.present(user, "no user on the session"); * user.name; // narrowed * ``` * * Use `ensure` instead when you want the value back rather than a narrowing. */ export declare class assert { private constructor(); static that(condition: unknown, message?: string): asserts condition; static number(value: unknown, message?: string): asserts value is number; static integer(value: unknown, message?: string): asserts value is number; /** Inclusive of both bounds. */ static inRange(value: unknown, min: number, max: number, message?: string): asserts value is number; static notNull(value: T, message?: string): asserts value is Exclude; static defined(value: T, message?: string): asserts value is Exclude; static present(value: T, message?: string): asserts value is Exclude; /** States that control cannot reach here, e.g. the default of an exhaustive switch. */ static unreachable(message?: string): never; }