Closed rorticus closed 4 years ago
The declare typings are not applying DeclareCreatedObject to the props object in the declare method. This means that you can't use this.inherited from inside a function passed into declare.
declare
DeclareCreatedObject
props
this.inherited
See the following example,
https://codesandbox.io/s/cool-galileo-sv5n3?file=/src/index.ts
It seems like it would be enough to add DeclareCreatedObject to the ThisType for each relevant entry in the Declare interface.
ThisType
Declare
i.e.,
<A, B>(superClass: DeclareConstructor<A> | [DeclareConstructor<A>], props: B & ThisType<DeclareCreatedObject & A & B>): DeclareConstructor<A & B>;
The
declare
typings are not applyingDeclareCreatedObject
to theprops
object in thedeclare
method. This means that you can't usethis.inherited
from inside a function passed intodeclare
.See the following example,
https://codesandbox.io/s/cool-galileo-sv5n3?file=/src/index.ts
It seems like it would be enough to add
DeclareCreatedObject
to theThisType
for each relevant entry in theDeclare
interface.i.e.,