/**
 * Public types for the consent detection framework.
 *
 * See docs/plans/current/2026-05-04-sdk-default-instrumentation-spec.md
 * Section X for the design rationale.
 */
import type { ConsentStatus } from './ConsentGate';
export interface ConsentAdapter {
    /** Stable identifier — used in telemetry / logs. */
    readonly name: string;
    /**
     * Synchronous detection: is this CMP currently present on the page?
     * Must be cheap and never throw. Just check for global presence
     * (e.g. `typeof window.Shopify?.customerPrivacy !== 'undefined'`).
     */
    detect(): boolean;
    /**
     * Subscribe to consent state. Returns immediately with a teardown
     * function. The callback fires:
     *   - Once with the current best-known state (could be 'pending' if
     *     adapter needs an async handshake).
     *   - Whenever the state changes (user accepts/rejects, etc).
     *
     * Adapters that need async initialization (e.g. Shopify's
     * loadFeatures) should fire 'pending' synchronously and update via
     * the callback when the async work finishes.
     */
    initialize(callback: (status: ConsentStatus) => void): () => void;
}
export interface DetectorOptions {
    /**
     * Adapters in priority order. First adapter whose `detect()` returns
     * true wins.
     */
    adapters: ConsentAdapter[];
    /**
     * Optional callback fired once when the detector picks a winning
     * adapter (or determines no adapter matched). Use for telemetry.
     */
    onAdapterSelected?: (name: string | null) => void;
    /**
     * Status to apply when no adapter matches. Typically wired to a
     * geo-aware function ("granted" outside EU, "denied" inside).
     * Defaults to 'pending' if not provided.
     */
    fallbackStatus?: () => ConsentStatus | Promise<ConsentStatus>;
}
