import React from 'react'; import { Epic } from 'redux-observable'; import { Action } from '../../../Actions'; import { DispatchAction } from '../../../Core/CommonTypes'; import { EpicDependencies } from '../../../Core/Store'; import { State, QuestionState } from '../../../StoreModules/QuestionStoreModule'; import { Parameter, ParameterValues, QuestionWithParameters } from '../../../Utils/WdkModel'; import { Props as FormProps } from '../../../Views/Question/DefaultQuestionForm'; export declare type Context = { searchName: string; parameter: T; paramValues: ParameterValues; }; export declare type Props = { ctx: Context; parameter: T; value: string; uiConfig?: Record; uiState: S; dispatch: DispatchAction; onParamValueChange: (value: string) => void; }; export declare type ParamModule = { isType: (parameter: Parameter) => parameter is T; /** * Determine if the param value is valid. This can be used by form container * to determine if submit should be disabled. The Component is responsible * for providing details about the invalid state. */ isParamValueValid: (context: Context, state: S) => boolean; reduce: (state: S, action: Action) => S; Component: React.ComponentType>; observeParam: Epic; /** * React to submit events. The Question will not be submitted until this is complete. */ getValueFromState: (context: Context, state: QuestionState, services: EpicDependencies) => string | Promise; }; declare type ParamModuleSpec = Partial> & Pick, 'isParamValueValid' | 'Component' | 'isType'>; export declare function createParamModule(spec: ParamModuleSpec): ParamModule; export declare function isPropsType(props: Props, predicate: (parameter: Parameter) => parameter is T): props is Props; export declare function isContextType(context: Context, predicate: (parameter: Parameter) => parameter is T): context is Context; export declare const useChangeParamValue: (parameter: Parameter, state: QuestionState, updateParamValue: FormProps['eventHandlers']['updateParamValue']) => (paramValue: string) => void; export declare function useDependentParamsAreUpdating(question: QuestionWithParameters, paramsUpdatingDependencies: Record): boolean; export declare function useParamDependenciesUpdating(question: QuestionWithParameters, paramsUpdatingDependencies: Record): Record; export declare function makeParamDependenciesUpdating(question: QuestionWithParameters, paramsUpdatingDependencies: Record): Record; export {}; //# sourceMappingURL=Utils.d.ts.map