BinghamtonBetterBus-v2/src/server/types.ts

9 lines
354 B
TypeScript

export type Point = { lat: number; lon: number };
type Integer<T extends number> = `${T}` extends `${string}.${string}` ? never
: T;
export type Int = Integer<number>;
type Positive<T extends number> = `${T}` extends `-${string}` ? never
: T;
type PositiveInteger<T extends number> = Positive<Integer<T>>;
export type Nat = PositiveInteger<number>;