import { ApiRequestOptions } from './client'; /** The backend code that means "this domain is not registered for checkout". */ export declare const ORIGIN_NOT_REGISTERED = "ORIGIN_NOT_REGISTERED"; export type CheckoutAvailabilityReason = /** Purchases work from this origin. */ 'available' /** The host domain is not on the allowlist; buying is refused. */ | 'origin-not-registered' /** Not asked, or the question could not be answered. Render nothing. */ | 'unknown'; export interface CheckoutAvailability { /** False ONLY when the origin was explicitly rejected. `unknown` is true. */ available: boolean; reason: CheckoutAvailabilityReason; /** The page's own origin, for the message. Empty during SSR. */ origin: string; } /** * True when the widget is running on a domain that is not the API's own. * * `getApiConfig().baseUrl` is a hard literal (`https://get-micdrop.com`), never * derived from the host page, so this is a genuine first-party/third-party test * and not a tautology. */ export declare function isCrossOriginEmbed(): boolean; /** * Subscribe to the answer. Fires immediately with whatever is already known, * and again if it changes. Returns an unsubscribe function. */ export declare function onCheckoutAvailabilityChange(listener: (_state: CheckoutAvailability) => void): () => void; /** * Record that a REAL buy-path call was refused for this origin. * * This is the authoritative signal — an actual cart or payment request, not a * probe — so it overrides a cached `available` and is what keeps the alert * correct if the domain is de-registered mid-session, or if the probe was * skipped entirely. Wired from the API client, which sees every failure code. */ export declare function noteCheckoutOriginRejected(): void; /** * Ask whether this origin may complete a purchase. * * Safe to call from every widget instance on the page: the first call owns the * request and the rest await it. */ export declare function probeCheckoutAvailability(req?: Pick): Promise; /** * Test seam: forget the memo, the cache and the subscribers. * @internal test-only reset of the module cache. */ export declare function resetCheckoutAvailability(): void;