Closed
Description
⚙ Compilation target
ESNext (ES2024?)
⚙ Library
typescript 5.7.3
Missing / Incorrect Definition
InstanceType is a built-in utility type that resolves a constructor into the type being constructed.
E.g. InstanceType<StringConstructor> = string, InstanceType<BooleanConstructor> = boolean, InstanceType<DateConstructor> = Date, etc
However, it errors out for InstanceType<BigIntConstructor> with the error:
Type does not satisfy the constraint abstract new (...args: any) => any .
Sample Code
InstanceType<BigIntConstructor>
Documentation Link
https://www.typescriptlang.org/docs/handbook/utility-types.html#instancetypetype
Metadata
Metadata
Assignees
Labels
No labels