jslib-nightly
Version:
SheerID JavaScript Library
60 lines (59 loc) • 3.19 kB
TypeScript
import { InjectedIntl } from 'react-intl';
import { FieldId, FieldValidationErrors, Organization, VerificationService, FieldContent, ExtendedFieldId, InputSelectOnKeyDown, FormSelectChoice, Country, ProgramTheme, Locale, ViewModel, State, PendingResponse, DocUploadResponse } from '../../types/types';
import { VerificationStepsEnum } from '../../types/runtimeTypes';
export declare const updateViewModelOrganization: (organization: Organization, verificationService: VerificationService) => void;
export declare const populateViewModelFromQueryParams: (verificationService: VerificationService) => void;
export declare const updateFieldValidationErrorsByFieldId: (fieldId: FieldId | ExtendedFieldId, value: FieldContent, verificationService: VerificationService) => void;
export declare const updateFieldValidationErrors: (fieldValidationErrors: FieldValidationErrors, verificationService: VerificationService) => void;
export declare const shouldCollectAddressFields: (countryChoice: FormSelectChoice<Country, string>, countries: Country[]) => boolean;
export declare const getAvailableMilitaryStatuses: (verificationService: VerificationService, intl: InjectedIntl) => FormSelectChoice[];
/**
* @private
*/
export declare const getFieldDisplayOrderFromRefs: () => FieldId[] | ExtendedFieldId[];
/**
* @private
*/
export declare const getFirstErroredFieldId: (fieldDisplayOrder: FieldId[] | ExtendedFieldId[], fieldValidationErrors: FieldValidationErrors) => FieldId | ExtendedFieldId;
/**
* HD-638 - focus on year, rather than month (which is an open <select> that covers error msg)
*/
export declare const adjustFirstErroredFieldId: (firstErroredFieldId: FieldId | ExtendedFieldId) => FieldId | ExtendedFieldId;
/**
* @private
*/
export declare const handleEmailOnKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
/**
* @private
*/
export declare const handleCountryOnKeyDown: InputSelectOnKeyDown;
/**
* @public
*/
export declare const submitForm: (viewModel: ViewModel, verificationService: VerificationService, step: VerificationStepsEnum) => void;
/**
* @public
* @description Help with commonly-accessed values. Returns the fully-resolved verbiage in the appropriate language.
* @return {Object}
*/
export declare const getEstAndMaxReviewTimes: (verificationResponse: DocUploadResponse | PendingResponse, programTheme: ProgramTheme, intl: any) => {
estReviewTime: string;
maxReviewTime: string;
};
/**
* @private
*/
export declare const getAvailableCountryChoices: (programTheme: ProgramTheme, intl: InjectedIntl) => FormSelectChoice<Country, string>[];
export declare const getAvailableStateChoices: (programTheme: ProgramTheme, intl: InjectedIntl) => FormSelectChoice<State, string>[];
/**
* @private
*/
export declare const getAvailableLocaleChoices: (programTheme: ProgramTheme, intl: InjectedIntl) => FormSelectChoice<Locale, string>[];
/**
* @private
*/
export declare const getDefaultCountryChoice: (countryChoices: FormSelectChoice<Country, string>[]) => FormSelectChoice<Country, string>;
/**
* @private
*/
export declare const produceDraftViewModel: <T extends ViewModel>(previousModel: T, key: keyof T, value: any) => T;