Integer<T>
Integer<
T
> =T
extendsunknown
?IsInteger
<T
> extendstrue
?T
:never
:never
Defined in: packages/react-querybuilder/src/types/type-fest/numeric.ts:104
A number
that is an integer.
Use-case: Validating and documenting parameters.
Type Parameters
Type Parameter |
---|
T |
Examples
type Integer = Integer<1>;
//=> 1
type IntegerWithDecimal = Integer<1.0>;
//=> 1
type NegativeInteger = Integer<-1>;
//=> -1
type Float = Integer<1.5>;
//=> never
// Supports non-decimal numbers
type OctalInteger: Integer<0o10>;
//=> 0o10
type BinaryInteger: Integer<0b10>;
//=> 0b10
type HexadecimalInteger: Integer<0x10>;
//=> 0x10
import type {Integer} from 'type-fest';
declare function setYear<T extends number>(length: Integer<T>): void;
See
- NegativeInteger
- NonNegativeInteger
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.