I am trying to figure out how to bind an interface with a type parameter, but I am unsure of the correct way to do it.
Here is the Interface:
...
export interface ITestHelper<Entity extends ObjectLiteral> {
doSomething(builder: SelectQueryBuilder<Entity>,
pagination: IPaginationParams): SelectQueryBuilder<Entity>;
}
export const TTestHelper = Symbol.for('ITestHelper');
ContainerModule Issue:
I attempted to bind as shown below, but I encountered an error stating 'Generic type 'ITestHelper' requires 1 type argument(s)'
...
export const TestContainerModule = new ContainerModule((bind: interfaces.Bind) => {
bind<ITestHelper>(TTestHelper)
.to(TestHelper)
.inSingletonScope();
});