Blopaa/Edno

Inject Class with constructor

Blopaa opened this issue · 1 comments

Expected Behavior

Inject class with constructor without problems

Current Behavior

type error when injecting

Possible Solution

update @Inject decorator param types

Steps to Reproduce

@Component()
class ToInject {
   constructor( private x: string ){
        this.x = "hi"
    }
}

@Controller("/path")
class Example {
    constructor( @Inject(ToInject) toInject ){} // error : TS2345: Argument of type 'typeof X' is not assignable to parameter of type 'new () => unknown'.   Types of construct signatures are incompatible.     Type 'new (c: string) => X' is not assignable to type 'new () => unknown'.
}

Context (Environment)

node version : v14.18.0
edno version: v2.2.0

duplicated pr