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