I'm looking for a way to extend a TypeScript object with a specific type. Here's an example scenario:
interface BaseInterface<T> {
staticA: string;
staticB: number;
dynamicA: T;
}
BaseInterface<SomeOtherInterfaceOrType>
When used in this manner, the dynamicA
type should be defined as SomeOtherInterfaceOrType
.
Is there a way to achieve this functionality? How can I create another interface that is of that type?