import { SetUserDefinedPropertyAction } from '../actions' ; import { formStateReducer } from '../reducer' ; import { AbstractControlState , FormState , isFormState } from '../state' ; import { ensureState } from './util' ; /**
 * This update function takes a name and a value and returns a projection
 * function that sets a user-defined property on a form state.
 */ export function setUserDefinedProperty ( name , value ) ; /**
 * This update function takes a form state, a name, and a value and sets
 * a user-defined property on the state.
 */ export function setUserDefinedProperty < TValue > ( state , name , value ) ; export function setUserDefinedProperty < TValue > ( nameOrState , valueOrName , value ? ) { if ( isFormState < TValue > ( nameOrState ) ) { return formStateReducer ( nameOrState , new SetUserDefinedPropertyAction ( nameOrState . id , valueOrName , value ) ) ; } return ( s ) => setUserDefinedProperty ( ensureState ( s ) , nameOrState as string , valueOrName ) ; }