UNPKG

@adyen/kyc-components

Version:

`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar

28 lines (27 loc) 1.21 kB
import type { Dispatch, StateUpdater } from 'preact/hooks'; import type { TopLevelDataSchema } from '../context/StateContext/types'; import type { AdditionalEventProperties } from '../core/user-events'; import type { EntityProblems } from '../core/models/errors/entity-problems'; import type { FormModelWithValidity } from '../core/models/form'; import type { Form } from './useMultiForm/types'; export interface FormComposer { handleNextClick(): void; handleBackClick?(): void; gotoFormByFormIndex(index: number): void; activeForm: FormModelWithValidity; shouldValidate: boolean; setShouldValidate: Dispatch<StateUpdater<boolean>>; steps: { current: number; total: number; }; } export declare const useFormComposer: <Schema extends TopLevelDataSchema = TopLevelDataSchema>({ problems, navigationTrackingParams, forms, externalBackClick, onSubmit, triggerValidation, }: { problems?: EntityProblems; navigationTrackingParams?: Partial<AdditionalEventProperties>; forms: FormModelWithValidity[]; formRef?: any; externalBackClick?(): void; onSubmit(): void; triggerValidation?: Form<Schema>["triggerValidation"]; }) => FormComposer;