I have an interface which requires a generic variable:
interface Action<T extends string> {
type: T
}
I am able to extend it when I set the value of the generic:
interface SomeAction extends Action<"something"> {
}
I would like to infer the generic automatically, but I get an error when I try this:
interface SomeAction extends Action {
type: "something"
}
Error TS2314: Generic type 'Action' requires 1 type argument(s).
I'd like the second example to infer its type automatically. Is this possible?