/** * TikTok handle cache. * * We can't reliably resolve "the currently logged-in TikTok user" via any * stable web URL (TikTok has no equivalent of `https://www.tiktok.com/me` * that resolves inside a WebView). Trying to infer the handle from cookies, * hydration data, or DOM selectors is fragile because TikTok churns those * surfaces frequently. * * Instead we use the only authoritative signal: the URL. When the user * navigates to `https://www.tiktok.com/@` (by tapping their profile * tab once), we capture that handle and cache it. Next time the same user * connects TikTok, we can open the WebView straight at their profile URL * and skip the "find your profile" guessing game entirely. * * This module owns the storage key + parsing helpers. No UI / no React. */ /** * Extracts a handle from any TikTok URL of the form * https://www.tiktok.com/@[/...] * Returns the handle (without the leading "@") or '' if the URL is not a * profile-shaped TikTok URL. * * Accepted (returns handle): * https://www.tiktok.com/@bruhnushka * https://www.tiktok.com/@bruhnushka/ * https://www.tiktok.com/@bruhnushka/liked * https://www.tiktok.com/@bruh.nushka_42 * * Rejected (returns ''): * https://www.tiktok.com/ (no handle) * https://www.tiktok.com/foryou (no handle) * https://www.tiktok.com/@bruh/video/12345 (video page, not profile) * https://www.tiktok.com/tag/cats (other section) */ export declare const extractTikTokHandleFromUrl: (rawUrl: string | null | undefined) => string; /** * Read the cached TikTok handle for this device. Returns '' when no handle * has been captured yet (or AsyncStorage is unavailable). */ export declare const getCachedTikTokHandle: () => Promise; /** * Persist a TikTok handle for future sessions. No-op for empty / falsy values * so callers don't have to guard against partial detections. */ export declare const setCachedTikTokHandle: (handle: string) => Promise; /** * Clear the cached handle. Useful when a user signs out / switches accounts. */ export declare const clearCachedTikTokHandle: () => Promise; /** * Build a canonical profile URL for a given handle. Returns '' for invalid * handles so callers can branch on truthiness. */ export declare const buildTikTokProfileUrl: (handle: string) => string; //# sourceMappingURL=tiktokHandleCache.d.ts.map