import type { EventHub } from '../../../common'; import { type SdkHandle, type StepOptionDocument } from '../../../common/vendors/onfido/onfido.types'; import type { Events, OCRRecipeOptions } from '../..'; /** * A host-callable teardown for an Onfido instance, safe to call at any time and * more than once (FDEL-53728 B1). * * Onfido renders into its own portal on ``, outside whatever element the * module was mounted into, so clearing the container cannot remove it — * `instance.tearDown()` is the only thing that does. Until this, teardown ran * only from Onfido's own onComplete / onError / onUserExit callbacks, so a host * ending the flow itself (`ocr.unmount()`, and through it the journey's * `stop()` / `destroy()`) left the applicant inside a live vendor UI. * * Guarded because those vendor callbacks tear down too: an `unmount()` after a * completed capture is ordinary, and a second `tearDown()` rejects. Without the * latch `removeOnfidoSdk` would turn that rejection into an `error` event and * report a vendor failure for a session that ended perfectly well. */ export declare const mkOnfidoUnmount: (instance: SdkHandle, opts: Parameters[1]) => (() => void); export declare const removeOnfidoSdk: (instance: SdkHandle, opts: { eventHub: EventHub; loadingEvent?: string; sdkVersion: number; userAnalyticsEventListener: EventListener; onfidoScriptElement?: HTMLScriptElement; /** Defaults to true. Pass false to tear down the SDK without announcing 'session_closed' yet, * e.g. when the caller wants to defer that event until results are ready. */ emitClosedEvent?: boolean; /** Names the component in the camera-access event. The IDV one-step flow shares this * teardown, so it passes 'idv'; everything else here is OCR. */ component?: "ocr" | "idv"; }) => Promise; export declare function declaringOnfidoSteps(documents: OCRRecipeOptions['documents'], hideCountrySelection?: boolean): StepOptionDocument; //# sourceMappingURL=shared.d.ts.map