import type { BillingCheckoutStatus } from "@opengeni/sdk"; import { type ReactNode } from "react"; /** * How the chat checks a credits payment the person makes from a payment page * card. Without it the card still opens the page; it just can't confirm. */ export type PaymentPageActivity = { /** Where one credits checkout stands (GET /v1/billing/checkout/:id). */ readCheckout?: ((input: { checkoutSessionId: string; accountId?: string | undefined; signal: AbortSignal; }) => Promise) | undefined; /** The checkout's credits reached the balance, so balances shown elsewhere refresh. */ onCredited?: ((status: BillingCheckoutStatus) => void) | undefined; }; /** How the payment page cards here check and report a payment. */ export declare function usePaymentPageActivity(): PaymentPageActivity; /** * Set how payment page cards below check and report a payment. What this * provider leaves out comes from the one around it, so a host can add * `onCredited` around a chat that already checks payments itself. */ export declare function PaymentPageActivityProvider({ children, readCheckout, onCredited, }: PaymentPageActivity & { children: ReactNode; }): import("react").JSX.Element; /** * A conversation's payment cards check payments through its own client * (the app's, or an embed's session proxy), unless a provider around the * conversation already says how. Clients without the billing read can't confirm. * * An agent's checkout is for the chat's organization unless it names another, * so a host that knows that organization passes it as `accountId`: without it * the read is for the person's default organization. (An embed's session proxy * already reads the chat workspace's organization whatever the browser sends.) * A host still finding out the chat's organization sets `accountPending`: * checks wait for it instead of asking the default organization and failing. */ export declare function ClientPaymentPageActivity({ client, accountId: chatAccountId, accountPending, children, }: { client: unknown; /** The chat's organization, for checkouts that don't name one. */ accountId?: string | null | undefined; /** The chat's organization isn't known yet: checks wait until it is. */ accountPending?: boolean | undefined; children: ReactNode; }): import("react").JSX.Element;