const Foo: new () => any = class {
constructor() {}
bar(): string {
return ‘Hello World!’;
}
};
const instance = new Foo();
below I want to replace any cause my config not allows any
new () => any
How can I define Foo()'s result ?
const Foo: new () => any = class {
constructor() {}
bar(): string {
return ‘Hello World!’;
}
};
const instance = new Foo();
below I want to replace any cause my config not allows any
new () => any
How can I define Foo()'s result ?
Copyright © 2021 Jogjafile Inc.
I suggest defining an interface named
Foo
to correspond to the instances that the class expression namedFoo
creates:Then you can declare
Foo
as typenew () => Foo
:Hope that helps; good luck!
Playground link to code