import type { ConsentConfigSnapshot, ConsentLoggerOptions, ConsentRecord } from './types.js'; /** * Reliable, fire-and-forget transport for consent records. * * - Prefers `navigator.sendBeacon` so a record survives the page navigation * that often follows "Accept all". The body uses a CORS-safelisted * content-type (`text/plain` by default), so the beacon reaches cross-origin * endpoints with no preflight and regardless of server CORS. * - If `contentType` is set to a non-safelisted type (e.g. `application/json`), * a cross-origin beacon would need a preflight beacons cannot perform and be * silently dropped, so `auto` falls back to `fetch(..., { keepalive: true })` * for cross-origin endpoints. keepalive fetch survives navigation too. * - Always uses `fetch` when custom headers are configured (beacons cannot set * headers). The `transport` option can force `'beacon'` or `'fetch'`. * - Buffers failed sends in `localStorage` and retries them on construction * (i.e. the next page load) and after the next successful send. * * The class is environment-tolerant: it reads `navigator`, `fetch` and * `localStorage` lazily and degrades gracefully when any are unavailable. */ export declare class ConsentLogger { #private; constructor(options: ConsentLoggerOptions); /** Send one consent record. Falls back to the offline queue on failure. */ log(record: ConsentRecord): void; /** * Upload a banner-config snapshot. Idempotent per revision: the first * successful upload for a given revision sets a localStorage flag, and later * calls for the same revision become no-ops until the flag is cleared. The * server should additionally dedupe on content hash (DSK-OH Rn. 85). * * Uses fetch only (not sendBeacon) because beacon's boolean return reflects * queueing, not delivery — we cannot set the per-revision dedup flag on a * value that doesn't represent an actual HTTP acknowledgement. */ logSnapshot(snapshot: ConsentConfigSnapshot): void; /** Attempt to resend any queued records (via fetch, so success is confirmed). */ flush(): Promise; } /** Convenience factory mirroring the `create()` style used elsewhere. */ export declare function createConsentLogger(options: ConsentLoggerOptions): ConsentLogger;