/** * Client-side mirror of the backend's canonicalization rules * (content-credits-backend/src/utils/canonicalHost.ts + canonicalUrl.ts, * see POST_IDENTITY_AND_REVAMP_PLAN.md §2.2). * * The backend stays authoritative — it re-canonicalizes everything the SDK * sends. This helper exists so the beacon (`/posts/observe`) and the paywall * (`/credits/*`) agree on post identity *before* the request leaves the * browser, and so the SDK can dedupe/display consistently offline. * * Policy (kept identical to the backend on purpose — do not drift): * - Fold `www.` -> apex, always. `www.example.com` === `example.com`. * - Do NOT fold other subdomains. `blog.example.com` stays distinct. * - Lowercase; strip protocol, port, path, query, fragment, trailing dot. * - Accept a bare hostname or a full URL; resolve punycode/IDN via the URL API. * - canonicalUrl: force https, drop fragment, drop tracking params * (utm_*, fbclid, gclid, ref, mc_cid/mc_eid, igshid), sort remaining * query params, normalize trailing slash. */ /** Mirrors backend `canonicalHost()` — fold www, lowercase, strip everything else. */ export declare function canonicalHost(input: string): string; /** Mirrors backend `canonicalUrl()` — the dedup key, never used for display. */ export declare function canonicalUrl(input: string): string;