WXL
5 天以前 871522ed7e06fd9c62a87c178d7f5c88d7853a20
1
2
3
4
5
6
7
8
9
10
import type { AnyFunction } from './isFunction.js';
export type AnyClass = new (...args: unknown[]) => unknown;
/**
 * Does a generic check to check that the given payload is of a given type. In cases like Number, it
 * will return true for NaN as NaN is a Number (thanks javascript!); It will, however, differentiate
 * between object and null
 *
 * @throws {TypeError} Will throw type error if type is an invalid type
 */
export declare function isType<T extends AnyFunction | AnyClass>(payload: unknown, type: T): payload is T;