import type { RecipeConfiguration } from '../common/types'; import type { OneSdkContext } from '../sdk/types/oneSDK'; import { JourneyName } from './types/contract'; import type { JourneyScreenConfig } from './flows/idvFlow'; import type { JourneyHandle } from './journeyHandle'; import type { ThemeTokens } from './theme/applyTheme'; export type JourneyOptions = JourneyScreenConfig & { style?: ThemeTokens; maxAttempts?: number; simulate?: string; }; /** * ekyc's options, minus the one that does not apply to it. * * `triggerVerificationOnSubmit` decides whether the flow calls * `individual().submit({ verify: true })` itself. `ekycFlow.ts` never does: * REVIEW's own `ReviewDocument.tsx` submits and reports the outcome, which is * why that flow does not call `submitAndClassify` at all. So on ekyc the flag * was accepted and silently ignored — a host could set it, watch the journey * verify anyway, and have nothing to read that explained why. * * `?: never` rather than a plain `Omit`: `Omit` alone only rejects the key on a * fresh object literal, so a host who builds their config into a variable first * would still slip through. This rejects both. */ export type EkycJourneyOptions = Omit & { triggerVerificationOnSubmit?: never; }; /** the options each flow accepts — see `EkycJourneyOptions` for the one difference */ type OptionsFor = TName extends JourneyName.EKYC ? EkycJourneyOptions : JourneyOptions; /** * Every journey screen is a react form screen — `RESULT_STATE`, the loading * config and the screen names all come from `form/vendors/react` — but the form * module takes its vendor from the recipe, so a recipe naming `legacy` or none * at all breaks the journey at its first screen. The journey's form screens get * a recipe whose provider is always `react`. * * A copy, never the SDK's own recipe: a classic `component('form')` keeps * whatever provider the account is configured with. Deep, because the form * module merges each screen's options into `provider.config` in place. A * provider that is already `react` is kept whole (`googleApiKey`, `config`); * any other is replaced, since a legacy or formio config means nothing to the * react vendor. */ export declare const forceReactFormProvider: (recipe: T) => T; export declare const mkJourney: (deps: { oneSdk: OneSdkContext; /** builds form screens from `forceReactFormProvider`'s recipe; see that function */ formComponent?: OneSdkContext["component"]; }) => (name: TName, options?: OptionsFor) => JourneyHandle; export {}; //# sourceMappingURL=index.d.ts.map