Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/deps/types.ts>NonNegativeInteger

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
type alias NonNegativeInteger
import { type NonNegativeInteger } from "https://deno.land/x/actionify@0.3.0/src/deps/types.ts";

A non-negative (0 <= x < ∞) number that is an integer. Equivalent to NonNegative<Integer<T>>.

You can't pass a bigint as they are already guaranteed to be integers, instead use NonNegative<T>.

Use-case: Validating and documenting parameters.

Examples

Example 1

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

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

Type Parameters

T extends number
definition: NonNegative<Integer<T>>