import type { FiatFlow } from '@funkit/connect-core'; import type { TFunction } from 'i18next'; import type { DepositFlowCallbacks, DepositMethod } from '../flow/depositFlowConfig'; import { type FunkitFlowError } from '../flow/flowError'; /** Reports a deposit's outcome to the host once, whichever screen reaches it first. */ export interface DepositOutcomeReporter { /** The order exists: the user leaving from here on is not a cancellation. */ ordered: () => void; /** * The deposit is on its way and the flow has closed behind it. Only the * settle path calls this; see `onDepositSubmitted` for what it promises. */ submitted: (orderId: string, method: DepositMethod['type']) => void; failed: (error: FunkitFlowError) => void; } type StepState = NonNullable['state']; /** * Lives above the flow session, which remounts on "back to entry": a report * belongs to the deposit, not to one session of it. Unmounting before any * report means the user left, and the host hears that as `cancelled`. */ export declare function useDepositOutcomeReporter({ callbacks, checkoutId, paymentMethod, t, }: { callbacks: Pick; checkoutId: string; paymentMethod: string; t: TFunction; }): DepositOutcomeReporter; /** Reads the flow's page and tells the reporter when it reaches an outcome. */ export declare function useDepositOutcome(flow: FiatFlow, reporter: DepositOutcomeReporter, t: TFunction): void; /** The host-facing error a terminal page stands for, or nothing while the flow is live. */ export declare function terminalError(screen: FiatFlow['page']['screen'], state: StepState | undefined, t: TFunction): FunkitFlowError | undefined; export {}; //# sourceMappingURL=depositOutcome.d.ts.map