I have a file named service.ts
which exposes the following code:
export interface SomeInterface {
keyOne: string;
}
export class TestService<T = SomeInterface> {
property: T;
}
In index.ts
file I am using the service:
import { TestService } from './service';
const service = new TestService();
service.property.keyOne
I also created index.d.ts
file which declare the same interface SomeInterface
with more keys:
export interface SomeInterface {
keyTwo: number;
}
The problem is that service.property
only "knows" the keyOne
property. How can I tell typescript to merge both of them?