Please, tell me, can I do this with ts? I have next source code:
interface FormStore<T> {
type: T;
}
interface Form<T> extends FormStore<T> {
email: T;
phone: T;
password: T;
}
interface FormState<R> {
form: Form<string>;
validate: Form<boolean>;
}
I want to reuse type FormState<R> and create new with argument. It something looks like replace Form on R:
// This example doesn't work, just only for example
interface FormState<R> {
form: R<string>;
validate: R<boolean>;
}
// another file
FormState<CustomForm>
R<string>it will not work. TS does not support higher kinded types