import { FormArrayState, FormState } from '../state'; import { ProjectFn2 } from './util'; export declare type FilterFn = (s: FormState, idx: number) => boolean; /** * This update function takes a filter function and one or more update functions * and returns a projection function that applies all update functions one after * another to each element of the form array state for which the filter function * returns `true`. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const arrayUpdateFn = updateArray( * (_, idx) => idx > 0, * validate(required), * markAsDirty, * ); * const updatedState = arrayUpdateFn(state); * ``` */ export declare function updateArrayWithFilter(filterFn: FilterFn, updateFn: ProjectFn2, FormArrayState>, ...updateFnArr: ProjectFn2, FormArrayState>[]): (state: FormArrayState) => FormArrayState; /** * This update function takes a filter function and an array of update functions * and returns a projection function that applies all update functions one after * another to each element of the form array state for which the filter function * returns `true`. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const arrayUpdateFn = updateArray( * (_, idx) => idx > 0, * [ * validate(required), * markAsDirty, * ], * ); * const updatedState = arrayUpdateFn(state); * ``` */ export declare function updateArrayWithFilter(filterFn: FilterFn, updateFnArr: ProjectFn2, FormArrayState>[]): (state: FormArrayState) => FormArrayState; /** * This update function takes a form array state, a filter function, and a variable * number of update functions and applies all update functions one after another to * each element of the form array state for which the filter function returns `true`. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const updatedState = updateArray( * state, * (_, idx) => idx > 0, * validate(required), * markAsDirty, * ); * ``` */ export declare function updateArrayWithFilter(state: FormArrayState, filterFn: FilterFn, updateFn: ProjectFn2, FormArrayState>, ...updateFnArr: ProjectFn2, FormArrayState>[]): FormArrayState; /** * This update function takes a form array state, a filter function, and an array of * update functions and applies all update functions one after another to each * element of the form array state for which the filter function returns `true`. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const updatedState = updateArray( * state, * (_, idx) => idx > 0, * [ * validate(required), * markAsDirty, * ], * ); * ``` */ export declare function updateArrayWithFilter(state: FormArrayState, filterFn: FilterFn, updateFnArr: ProjectFn2, FormArrayState>[]): FormArrayState; /** * This update function takes one or more update functions and returns a * projection function that applies all update functions one after another to * each element of the form array state. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const arrayUpdateFn = updateArray( * validate(required), * markAsDirty, * ); * const updatedState = arrayUpdateFn(state); * ``` */ export declare function updateArray(updateFn: ProjectFn2, FormArrayState>, ...updateFnArr: ProjectFn2, FormArrayState>[]): (state: FormArrayState) => FormArrayState; /** * This update function takes an array of update functions and returns * a projection function that applies all update functions one after another to * each element of the form array state. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const arrayUpdateFn = updateArray([ * validate(required), * markAsDirty, * ]); * const updatedState = arrayUpdateFn(state); * ``` */ export declare function updateArray(updateFnArr: ProjectFn2, FormArrayState>[]): (state: FormArrayState) => FormArrayState; /** * This update function takes a form array state and one or more update functions * and applies all update functions one after another to each element of the form * array state. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const updatedState = updateArray( * state, * validate(required), * markAsDirty, * ); * ``` */ export declare function updateArray(state: FormArrayState, updateFn: ProjectFn2, FormArrayState>, ...updateFnArr: ProjectFn2, FormArrayState>[]): FormArrayState; /** * This update function takes a form array state and an array of update * functions and applies all update functions one after another to each element * of the form array state. * * The following (contrived) example uses this function to validate all its * children to be required and mark them as dirty. * * ```typescript * const updatedState = updateArray( * state, * [ * validate(required), * markAsDirty, * ], * ); * ``` */ export declare function updateArray(state: FormArrayState, updateFnArr: ProjectFn2, FormArrayState>[]): FormArrayState;