declare function nowSeconds(nowMs: unknown): number; export declare function applyCookiePrefix(cookiePrefix: unknown, cookieName: unknown): string; export declare function buildD8aClientCookieName(cookiePrefix?: unknown): string; export declare function buildD8aCookieName(propertyId: unknown, cookiePrefix?: unknown): string; export declare function parseD8aClientCookie(value: unknown): { cid: string; } | null; /** * Generates the core cid parts (random + timestamp). * Shared by both cookie-based and anonymous cid flows. */ export declare function generateCidParts({ nowMs }?: { nowMs?: unknown; }): { random: number; timestampSec: number; }; /** * Formats cid parts into the canonical cid string. */ export declare function formatCid({ random, timestampSec }: { random: unknown; timestampSec: unknown; }): string; export declare function buildD8aClientCookieValue({ nowMs }?: { nowMs?: unknown; }): string; export declare function buildD8aClientCookieValueFromCid(cid: unknown): string | null; export type SessionToken = { key: string; val: string; raw?: string; known: boolean; }; declare function tokenizeSessionCookie(raw: unknown): SessionToken[] | null; declare function detokenizeSessionCookie(tokens: SessionToken[]): string; declare function getToken(tokens: SessionToken[], key: string): string | null; declare function setToken(tokens: SessionToken[], key: string, val: unknown): void; export declare function parseD8aSessionCookie(value: unknown): { tokens: SessionToken[]; sid: number | null; sct: number | null; lastEventTs: number | null; seg: number | null; } | null; /** * Updates an existing session cookie tokens array or creates a new one. * * This is intentionally minimal in the current implementation: * - inactivity timeout creates a new session (new `s`, increment `o`) * - every event updates `t` and increments `j` * - preserves unknown tokens and token order where possible */ export declare function updateD8aSessionCookieTokens(existingTokens: SessionToken[] | null, { nowMs, sessionTimeoutMs }?: { nowMs?: unknown; sessionTimeoutMs?: unknown; }): { tokens: SessionToken[]; isNewSession: boolean; }; export declare function serializeD8aSessionCookieTokens(tokens: SessionToken[]): string; export declare const __internal: { SESSION_PREFIX: string; tokenizeSessionCookie: typeof tokenizeSessionCookie; detokenizeSessionCookie: typeof detokenizeSessionCookie; getToken: typeof getToken; setToken: typeof setToken; nowSeconds: typeof nowSeconds; applyCookiePrefix: typeof applyCookiePrefix; }; export {};