xxxxxxxxxx
type Type1<T = any> = OtherType<T>
// or
type Type2<T = void> = OtherType<T>
xxxxxxxxxx
// Define a generic interface with a default type for the type parameter
interface MyGenericInterface<T = string> {
value: T;
}
// Usage examples
const stringInstance: MyGenericInterface = { value: "Hello" }; // T will be inferred as string
const numberInstance: MyGenericInterface<number> = { value: 42 }; // T will be number
const booleanInstance: MyGenericInterface<boolean> = { value: true }; // T will be boolean