Skip to main content

NonNegative<T>

NonNegative<T> = T extends Zero ? T : Negative<T> extends never ? T : never

Defined in: packages/react-querybuilder/src/types/type-fest/numeric.ts:189

A non-negative number/bigint (0 <= x < ∞).

Use-case: Validating and documenting parameters.

Type Parameters

Type Parameter
T extends Numeric

See

  • NonNegativeInteger
  • Negative

Example

import type {NonNegative} from 'type-fest';

declare function setLength<T extends number>(length: NonNegative<T>): void;

caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.