import { Type } from "@angular/core"; import { DeepPropType, Maybe, NotNull } from "@fretve/global-types"; import { AbstractDynamicControl, AllowFormStateSelectors, ControlArrayComponent, ControlComponent, ControlFieldComponent, ControlGroupComponent, ControlOptions, DefaultControlArrayComponentOptions, DefaultControlGroupComponentOptions, DynamicControlArray, DynamicControlArrayOptions, DynamicControlField, DynamicControlFieldOptions, DynamicControlGroup, DynamicControlGroupOptions, GetValueTypeFromControl, GetViewOptionsFromComponent, GetViewOptionsFromControl } from "../interfaces"; declare type NotFound = "$$PROP_NOT_FOUND"; /** Check if the given properties TSlice are found on TForm, also searching in nested objects. */ export declare type ValidFormSlice = keyof { [P in TSlice as DeepPropType extends NotFound ? NotFound : never]: true; } extends never ? TSlice : never; /** Represents a map of properties from TForm with an associated control */ export declare type ValidControlSchemaMap = { [P in keyof TForm]: ValidControlSchema; }; /** Represents valid controls for TValueType */ export declare type ValidControlSchema = ControlFieldSchema> | undefined> | ControlArraySchema, TValueType extends (infer V)[] ? ValidControlSchema> : never, Type> | undefined> | ControlGroupSchema : never, Partial, ValidControlSchemaMap : never, TInputState>, Maybe>>>; /** Represents a map of properties from TForm with an associated control schema */ export declare type ControlSchemaMap = { [P in keyof TForm]: AbstractDynamicControl>>, any>; }; export declare type DynamicControlMapFromSchema> = { [P in keyof TMap]: ConvertSchemaToControl; }; export declare type ConvertSchemaToControl = TSchema extends ControlGroupSchema<(infer ValueType), any, (infer ControlMap), (infer Component)> ? DynamicControlGroup, Component> : TSchema extends ControlArraySchema ? DynamicControlArray : TSchema extends ControlFieldSchema<(infer ValueType), (infer Component)> ? DynamicControlField : never; /** Represents a group of controls, and relationships between them. */ export interface ControlGroupSchema, TGroupComponent extends Maybe>>> extends DynamicControlGroup, ControlGroupOverridables> { } /** Represents a group of controls, and relationships between them. */ export interface ControlArraySchema, TArrayComponent extends Type, any>> | undefined = undefined> extends DynamicControlArray, TInputState, GetValueTypeFromControl, TTemplate, TArrayComponent>, ControlArrayOverridables, TInputState, TTemplate, GetViewOptionsFromComponent> { } /** Describes the rendering, value and validation of an form control field */ export interface ControlFieldSchema> | undefined = undefined> extends DynamicControlField<{}, {}, TValueType, TControlComponent>, ControlFieldOverridables<{}, {}, GetViewOptionsFromComponent> { } /** Represents a map of controls and their configurable properties, allowing form state selectors. */ export declare type ControlOverridesMap> = { [P in keyof TControls]?: TControls[P] extends ControlArraySchema ? ControlArrayOverrides : TControls[P] extends ControlGroupSchema ? ControlGroupOverrides : TControls[P] extends ControlFieldSchema ? ControlFieldOverrides : ControlFieldOverrides; }; /** Get corresponding overrides object for a given TControl */ export declare type ControlOverrides> = TControl extends ControlArraySchema ? ControlArrayOverrides : TControl extends ControlGroupSchema ? ControlGroupOverrides : TControl extends ControlFieldSchema ? ControlFieldOverrides : ControlFieldOverrides; /** Represents an object of configurable properties on TGroup, allowing form state selectors. */ export declare type ControlGroupOverrides> = Partial>>>; /** Represents an object of configurable properties on TGroup, allowing form state selectors. */ export declare type ControlArrayOverrides> = Partial>>>; /** Represents an object of configurable properties on TControl, allowing form state selectors. */ export declare type ControlFieldOverrides> = Partial>>>; /** Represents overridable */ export interface ControlGroupOverridables, TViewOptions extends object> extends ControlOverridables, AllowFormStateSelectors { overrides?: ControlOverridesMap; } export interface ControlArrayOverridables, TViewOptions extends object> extends ControlOverridables, AllowFormStateSelectors { templateOverrides?: ControlOverrides; } export interface ControlFieldOverridables extends ControlOverridables, AllowFormStateSelectors { } export interface ControlOverridables extends AllowFormStateSelectors { viewOptions: AllowFormStateSelectors; } export {};