type-plus
Version:
Provides additional types for TypeScript.
18 lines • 667 B
TypeScript
import type { AnyConstructor } from './AnyConstructor.js';
/**
* Is the subject a constructor function.
*
* @deprecated this is not a failsafe test,
* it will return true for any function that can be called with `new`.
*
* If the subject is an arrow function,
* it can still return true after compilation.
*
* Thus this function is not safe to use.
*/
export declare function isConstructor(subject: unknown): subject is AnyConstructor;
/**
* instanceof type guard for unknown value.
*/
export declare function isInstanceof<T extends AnyConstructor>(subject: unknown, constructor: T): subject is InstanceType<T>;
//# sourceMappingURL=isConstructor.d.ts.map