/** * Cookie utility module for CoolhandJS fingerprint and state tracking * * Handles generation and persistence of: * - Unique fingerprint ID for user tracking * - Feedback viewed state for auto-highlight feature * * Uses SameSite=None; Secure for cross-site (iframe) support. * * Cookie format (JSON): * { * "fingerprint": "", * "feedbackViewed": false * } * * Legacy format (plain UUID string) is supported for backward compatibility. */ /** * Generate a UUID v4 string * * Uses crypto.randomUUID() when available (modern browsers), * falls back to crypto.getRandomValues(), then Math.random() as last resort. */ export declare function generateUUID(): string; /** * Validate that a string is a valid UUID v4 */ export declare function isValidUUID(value: string): boolean; /** * Get a cookie value by name */ export declare function getCookie(name: string): string | null; /** * Set a cookie with security best practices * * Uses SameSite=None; Secure for cross-site (iframe) support. * Requires HTTPS - returns false on HTTP. */ export declare function setCookie(name: string, value: string, days: number): boolean; /** * Check if cookies are supported and enabled */ export declare function isCookieSupported(): boolean; /** * Get or create a fingerprint ID * * - If a valid fingerprint cookie exists, returns its value (and refreshes expiration) * - If no cookie exists, generates a new UUID and stores it * - Returns null if cookies are blocked or HTTPS is required but not available * * Note: Cookie is refreshed on every call to work around Safari ITP 7-day limit */ export declare function getOrCreateFingerprintId(): string | null; /** * Check if feedback has been viewed (user has interacted with any feedback widget) * * Returns false if: * - Cookies are not supported * - Cookie doesn't exist * - Cookie exists but feedbackViewed is false * - Legacy cookie format (plain UUID) */ export declare function hasFeedbackBeenViewed(): boolean; /** * Mark feedback as viewed (user has interacted with a feedback widget) * * Updates the cookie to set feedbackViewed = true. * Creates a new cookie with fingerprint if one doesn't exist. * * Returns true if cookie was updated successfully, false otherwise. */ export declare function markFeedbackAsViewed(): boolean; //# sourceMappingURL=cookie.d.ts.map