jslib-nightly
Version:
SheerID JavaScript Library
61 lines (60 loc) • 2.72 kB
TypeScript
import { Dispatch } from 'redux';
import { DatabaseId, VerificationResponse, ViewModel, BoundAction, BoundActionCreator, Segment } from '../types/types';
/**
* @description Start a new verification "flow"
* @param dispatch Redux action dispatch
*/
export declare const createFetchNewVerificationRequest: BoundActionCreator;
/**
* @description Provided with a verificationId, continue verifying someone.
* @param dispatch Redux action dispatch
*/
export declare const createFetchExistingVerificationRequest: BoundActionCreator;
export declare const segmentChanged: (currentSegment: Segment, nextSegment: Segment) => boolean;
export declare const currentStepChanged: (previousVerificationResponse: VerificationResponse, verificationResponse: VerificationResponse) => boolean;
/**
* @description Await several items (new/existing verification request, program theme, etc) then update central state (redux).
* Timing and order is very important within this function as it is bootstrapping most of the application.
*
* @param dispatch Redux action dispatch
* @param verificationResponsePromise Either a new or existing verification server request.
* @param programId
* @param previousViewModel Optional
* @private
*/
export declare const createFetchVerificationRequest: ({ dispatch, verificationResponsePromise, programId, segment, previousViewModel, previousVerificationResponse, }: {
dispatch: Dispatch;
programId: DatabaseId;
verificationResponsePromise: Promise<VerificationResponse>;
segment?: Segment;
previousViewModel?: ViewModel;
previousVerificationResponse?: VerificationResponse;
}) => Promise<any>;
/**
* @description Action creator to update the view model in redux.
* @param dispatch
*/
export declare const createUpdateViewModel: BoundActionCreator;
declare type CreateUpdateProps = (dispatch: Dispatch, programId: DatabaseId) => BoundAction;
export declare const createUpdateLocale: CreateUpdateProps;
/**
* @description Action creator to update the program theme in redux.
* @param dispatch
*/
export declare const createUpdateProgramTheme: BoundActionCreator;
/**
* @description Action creator to update the field validation errors, which are those that are shown to a user as they fill-in the HTML form.
* @param dispatch
*/
export declare const createUpdateFieldValidationErrors: BoundActionCreator;
/**
* @description Action creator to submit a step to the backend REST API
* @param dispatch
*/
export declare const createSubmitStep: BoundActionCreator;
/**
* Perform the actual viewModel reset actions
* @private
*/
export declare const doViewModelReset: (dispatch: Dispatch) => (verificationResponse: VerificationResponse) => Promise<any>;
export {};