/**
 * ConsentGate - GDPR-compliant consent management for telemetry.
 *
 * Gates PostHog (and any future telemetry provider) initialization on
 * user consent status. Supports:
 * - Explicit consent requirement (opt-in model)
 * - GTM Consent Mode v2 integration (reads analytics_storage from dataLayer)
 * - Programmatic grant/deny API for host page consent banners
 *
 * The ConsentGate lives in the runtime (not the PostHog adapter) because
 * consent is provider-agnostic — if we switch from PostHog to Segment or
 * another provider, consent logic should not change.
 */
export type ConsentStatus = 'granted' | 'denied' | 'pending';
export interface ConsentConfig {
    /** Initial consent status. Default: 'pending' */
    initialStatus?: ConsentStatus;
    /** If true, telemetry is blocked until grant() is called. Default: false */
    requireExplicitConsent?: boolean;
    /** Read consent state from GTM's window.dataLayer consent events. Default: false */
    readFromGtmConsentMode?: boolean;
    /** Called whenever consent status changes. */
    onConsentChange?: (status: ConsentStatus) => void;
    /**
     * Resolves what 'pending' should be treated as for users who have not
     * explicitly granted/denied (no banner interaction yet).
     *
     * For ROW (rest of world): typically returns 'granted' (opt-out regimes).
     * For EU/UK/CH: returns 'denied' (explicit-opt-in regimes).
     *
     * Called lazily by `resolvePending()`. If not provided, defaults to 'denied'.
     */
    pendingResolver?: () => Promise<ConsentStatus>;
}
type ConsentListener = (status: ConsentStatus) => void;
export declare class ConsentGate {
    private status;
    private listeners;
    private configCallback?;
    private gtmEnabled;
    private destroyed;
    private pendingResolverFn?;
    constructor(config?: ConsentConfig);
    /**
     * Grant consent — enables telemetry collection.
     */
    grant(): void;
    /**
     * Deny consent — disables telemetry collection.
     */
    deny(): void;
    /**
     * Get the current consent status.
     */
    getStatus(): ConsentStatus;
    /**
     * Subscribe to consent status changes.
     * Returns an unsubscribe function.
     */
    subscribe(listener: ConsentListener): () => void;
    /**
     * Subscribe to the next definitive (granted | denied) status change,
     * then auto-unsubscribe. If status is already definitive, fires
     * synchronously (next microtask) with current status.
     *
     * Used by D-2 (URL-param identify) to defer the identify() call
     * until consent is decided.
     */
    subscribeOnce(listener: ConsentListener): () => void;
    /**
     * Resolve what the current 'pending' state should be treated as,
     * via the configured pendingResolver. Returns the current status
     * directly if it's already 'granted' or 'denied'.
     *
     * Defaults to 'denied' if no resolver is configured (conservative).
     */
    resolvePending(): Promise<ConsentStatus>;
    /**
     * Public setter — used by ConsentDetector / adapters to push state changes.
     */
    setStatus(newStatus: ConsentStatus): void;
    /**
     * Poll GTM's dataLayer for consent state.
     * Scans for the most recent consent update event with analytics_storage.
     */
    pollGtmConsent(): void;
    /**
     * Clean up listeners and stop responding to changes.
     */
    destroy(): void;
    private applyStatus;
    private notify;
}
export {};
