ngx-typed-reactive-form
Version:
Make Angular Reactive Forms strongly typed with generics.
8 lines (7 loc) • 505 B
TypeScript
import { TypedFormArray } from '../typed-reactive-controls/typed-form-array.type';
import { TypedFormControl } from '../typed-reactive-controls/typed-form-control.type';
import { TypedFormGroup } from '../typed-reactive-controls/typed-form-group.model';
import { Primitive } from './primitive.type';
export declare type NestedControl<T> = {
[P in keyof T]: T[P] extends Primitive | Array<Primitive> ? TypedFormControl<T[P]> : T[P] extends Array<infer U> ? TypedFormArray<U> : TypedFormGroup<T[P]>;
};