Closed hasezoey closed 1 year ago
Duplicate of #32452.
Duplicate of #32452.
weird, i tried searching for that, but didnt find it - though granted i did not search through all 14 (or with some terms more) pages
Duplicate of https://github.com/microsoft/TypeScript/issues/32452
I used this search term: constructor type in:title
lib Update Request
Configuration Check
My compilation target is
es2019
and my lib isesnext
.Missing / Incorrect Definition
.constructor
on class instances should return the propertypeof Class
type instead ofObject.constructor: Function
Sample Code
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor
i would need this as a opposite of
InstanceType<typeof Class>
, for exampletype TypeofClass<T extends { constructor: new (...args: any[]) => any }> = T extends { constructor: infer S } ? S : never;