import { type ConsentCategory, type ConsentChoice, type ConsentRegion } from "../shared/consent.js"; export type { ConsentCategory, ConsentChoice, ConsentRegion }; /** The visitor's stored choice, or `null` before they've made one. */ export declare function getConsentChoice(): ConsentChoice | null; /** * Whether this visitor gets the banner: the server's answer from the * request's country, else the browser's time zone. Asked once a session. */ export declare function resolveConsentRegion(): Promise; /** * Whether `category` is allowed right now, on the time zone's guess until the * server answers. Pair it with `whenConsentAllows` and a `revoke` that undoes * whatever this let through. */ export declare function consentAllowsNow(category: ConsentCategory): boolean; /** * Whether `category` is allowed, from the visitor's choice or the server's * region; `null` until one of them is known, where `consentAllowsNow` would * guess from the time zone. For what `revoke` can't undo once it's sent. */ export declare function consentDecision(category: ConsentCategory): boolean | null; export interface WhenConsentAllowsOptions { /** * Run now on the time zone's guess instead of waiting for the server, and * call `revoke` if the server or the visitor then says no. Only for storage * `revoke` can fully undo; a third-party script can't be unloaded. */ optimistic?: boolean; revoke?: () => void; } /** * Run `run` once `category` is allowed: at once outside the consent region, * and inside it when the visitor accepts. A later "reject" calls `revoke`. */ export declare function whenConsentAllows(category: ConsentCategory, run: () => void, options?: WhenConsentAllowsOptions): void; /** * Run `send` once the visitor's choice or the server's region is known, so * the time zone's guess never sends what consent covers. `decided` is false * when the page closes first; send then without what consent covers. */ export declare function whenConsentDecided(send: (decided: boolean) => void): void; /** Store the visitor's choice for every app on this site, and apply it. */ export declare function setConsentChoice(choice: ConsentChoice): void; /** Reopen the banner so the visitor can change their choice. */ export declare function openConsentSettings(): void; /** Whether the banner should show now, for the banner component. */ export declare function shouldShowConsentBanner(): boolean; export declare function subscribeConsent(listener: () => void): () => void;