import type { OneSdkContext } from '../../sdk/types/oneSDK'; import type { FirstPaintSignal } from '../steps/firstPaint'; import type { StepMachine } from '../steps/stepMachine'; import type { JourneyResultConfig } from '../types/resultConfig'; export type JourneyScreenConfig = { container: HTMLElement; withStart?: boolean; /** * WELCOME and CONSENT are on unless set to `false`: nearly every host wants * both, so opt-in left every integration repeating `true`. CONSENT still * skips itself when the applicant has already consented. */ withWelcome?: boolean; withConsent?: boolean; withReview?: boolean; /** * Whether the journey mounts its own terminal RESULT screen. Defaults to * `true` — it renders today, so turning it off cannot be a silent breaking * change, which is why this toggle is opt-OUT where `withStart` and * `withReview` are opt-in. * * Off means the host owns the ending: `start()` resolves as soon as the * outcome is known, nothing is mounted, and the container is emptied on * settlement (`journeyHandle.ts`'s `cleanupOnSettle`) so the host can * immediately reuse it. * * Governs the TERMINAL screen only. The PARTIAL screen shares the same * component but is part of the data-correction retry, not an ending — * `withReview: false` is what disables that path. */ withResult?: boolean; /** * The form module's native RESULT config, per screen state, verbatim — the * same passthrough `review`, `welcome` and `consent` already have. Layered * over the SDK's own defaults (`result.config.ts`'s `resultInfoMapping`), so * naming one key overrides only that key. * * The journey keeps `state`: the outcome decides which card renders. A `cta` * here also decides settlement — see `screens/resultScreen.ts`. `PARTIAL` is * the data-correction retry card and is NOT governed by `withResult`. */ result?: JourneyResultConfig; /** * Whether the flow calls `individual().submit({ verify: true })` itself. * Defaults to `true`; `false` settles `success / captured` instead, for a * host that verifies server-side on its own schedule. * * **idv and ocr only.** `ekycFlow.ts` never calls `submitAndClassify` — * REVIEW's own `ReviewDocument.tsx` submits and reports the outcome — so the * flag has nothing to switch there. `EkycJourneyOptions` in `../index.ts` * types it away for that flow rather than leaving it silently ignored. */ triggerVerificationOnSubmit?: boolean; /** * TEST SEAM — not a customer-facing option. Begins the journey at a later * step, skipping everything before it, so a single screen's config can be * exercised without walking the whole flow. * * `'REVIEW'` is the one that cannot be reached any other way: the review * screen normally requires a completed vendor capture, so testing review field * config otherwise means a real document scan per iteration. It composes with * `simulate` (which settles an outcome without a vendor) and, like it, produces * states a real applicant cannot reach — the review form opens with whatever * data the entity already has, which for a fresh entity is nothing. */ startAt?: 'CAPTURE' | 'REVIEW'; logo?: string; welcome?: Record; consent?: Record; /** * The form module's native REVIEW config, verbatim. Keeps the per-country / * per-state structure — the journey does not flatten or translate it, because * any simplified shape would have to grow that structure back. */ review?: Record; start?: Record; /** ekycFlow.ts only — the form module's native PERSONAL/DOCUMENT config, verbatim */ personal?: Record; document?: Record; /** * ekycFlow.ts only — the form module's native RETRY config, verbatim. The * data-correction retry's own screen (`Retry.tsx`), not `review`'s config: * it renders `` once it lands back on REVIEW, and that * still reads `review`'s config (the react form vendor's redux store is a * module-level singleton — `modules/form/vendors/react/redux/store.ts` — * so the REVIEW slot populated by the main attempt persists into the retry * mount without needing to be repeated here). */ retry?: Record; /** * idvFlow.ts/ocrFlow.ts only — the form module's native LOADING config for * the screen shown over the container while the vendor's capture UI boots. * That screen is a bare spinner by default; pass `title`/`descriptions` * here to put copy back. */ captureLoader?: Record; /** * idvFlow.ts/ocrFlow.ts only — the form module's native LOADING config for * the screen shown while the verification submit is in flight. Defaults to * `manualLoading`, the SDK's own copy for this moment. */ verifying?: Record; }; /** * How the DOCUMENT screen was left. Alone among the screen steps it has two * exits, not one: `'ready'` is `form:document:ready` (an ID type was picked) * and `'back'` is IdSelection.tsx's "Back" link, which returns to PERSONAL. * See `stepTable.ts`'s DOCUMENT row. */ export type DocumentExit = 'ready' | 'back'; export type ScreenSequence = { presentPreCapture: () => Promise; presentConsent: () => Promise; showCaptureLoader: () => Promise; hideCaptureLoader: () => void; removeVendorFrames: () => void; showExtraction: () => void; hideExtraction: () => void; showVerifying: () => void; hideVerifying: () => void; presentPersonal: () => Promise; presentDocument: () => Promise; presentReview: () => Promise; presentPartial: () => Promise; unmountAll: () => void; }; export declare const mkScreenSequence: (deps: { oneSdk: OneSdkContext; config: JourneyScreenConfig; machine: StepMachine; firstPaint: FirstPaintSignal; }) => ScreenSequence; //# sourceMappingURL=screenSequence.d.ts.map