import { B as BridgeMessage, C as CherryMiniApp } from './client-Bi55Q6eQ.js'; export { a as BRIDGE_VERSION, b as BridgeEvent, c as BridgeInitMessage, d as BridgeReadyMessage, e as BridgeRequest, f as BridgeResponse, g as CherryBlinkContext, h as CherryEnvironment, i as CherryMiniAppEvent, j as CherryMiniAppOptions, k as CherryNavigate, l as CherryPlatform, m as CherryRoom, n as CherryUser, o as CherryWallet, L as LaunchTokenPayload, S as ShareBlinkOptions, p as ShareBlinkResult } from './client-Bi55Q6eQ.js'; export { D as DetectPlatformOptions, d as detectPlatform, g as getCherryEnvironment, i as isInsideCherry, v as verifyLaunchToken } from './token-Drin0T5e.js'; type MessageHandler = (message: BridgeMessage) => void; declare class Bridge { private readonly pending; private readonly handlers; private readonly listener; /** * Buffer for cherry:init — if the host sends it before any handler is * registered (i.e. before cherry.init() is called), we keep it here so * waitForInit() can resolve immediately instead of timing out. */ private _bufferedInit; constructor(); /** * Returns a previously buffered cherry:init message (if any) and clears the * buffer. Called by waitForInit() to handle the case where the host sent * cherry:init before the SDK called init(). */ consumeBufferedInit(): BridgeMessage | null; sendToHost(message: BridgeMessage): void; startListening(handler: MessageHandler): () => void; request(method: string, params?: Record): Promise; destroy(): void; } declare class BridgeError extends Error { readonly code: string; constructor(message: string, code: string); } declare function getSharedBridge(): Bridge; declare function destroySharedBridge(): void; declare const CHERRY_JWKS_URL = "https://chat.cherry.fun/.well-known/jwks.json"; declare const CHERRY_ISSUER = "https://chat.cherry.fun"; interface CherryCustomAuthConfig { /** The raw JWT launch token to pass to Privy's `loginWithCustomAccessToken()`. */ token: string; /** JWKS URL for Privy Dashboard configuration. */ jwksUrl: string; /** Issuer value for Privy Dashboard configuration. */ issuer: string; } /** * Extracts the launch token and auth configuration needed to use Cherry * as a custom auth provider in Privy (or any OIDC/JWKS-compatible system). * * Usage with Privy: * ```ts * const cherry = useCherryApp(); * const { loginWithCustomAccessToken } = usePrivy(); * * if (cherry?.isReady) { * const { token } = getCherryCustomAuthConfig(cherry); * await loginWithCustomAccessToken(token); * } * ``` * * Privy Dashboard setup: * 1. Settings → Custom Auth → Add Provider * 2. JWKS URL: `https://chat.cherry.fun/.well-known/jwks.json` * 3. Issuer: `https://chat.cherry.fun` * 4. User ID field: `sub` */ declare function getCherryCustomAuthConfig(cherry: CherryMiniApp): CherryCustomAuthConfig; export { Bridge, BridgeError, BridgeMessage, CHERRY_ISSUER, CHERRY_JWKS_URL, type CherryCustomAuthConfig, CherryMiniApp, destroySharedBridge, getCherryCustomAuthConfig, getSharedBridge };