ts-type-guards
Version:
Curried TypeScript type guards for primitive types and classes
17 lines (16 loc) • 1.05 kB
TypeScript
import { primitive, Classy, TypeGuard } from "./types";
export declare function isBoolean(x: unknown): x is boolean;
export declare function isBooleanLike(x: unknown): x is boolean | Boolean;
export declare function isNumber(x: unknown): x is number;
export declare function isNumberLike(x: unknown): x is number | Number;
export declare function isString(x: unknown): x is string;
export declare function isStringLike(x: unknown): x is string | String;
export declare function isSymbol(x: unknown): x is symbol;
export declare function isNull(x: unknown): x is null;
export declare function isUndefined(x: unknown): x is undefined;
export declare function isNothing<T>(x: T | undefined | null): x is null | undefined;
export declare function isSomething<T>(x: T | undefined | null): x is T;
export declare function isPrimitive(x: unknown): x is primitive;
export declare function isNonPrimitive(x: unknown): x is object;
export declare function is<T>(type: Classy<T>): TypeGuard<T>;
export declare function isLike<T>(reference: T): TypeGuard<T>;