/** * WeChat QR 码登录流程 * * 管理 QR 码生成、状态轮询和凭证持久化 * 活跃登录会话存储在 globalThis 中以支持 HMR */ export interface QrLoginSession { qrcode: string; qrImage: string; startedAt: number; refreshCount: number; status: 'waiting' | 'scanned' | 'confirmed' | 'expired' | 'failed'; accountId?: string; error?: string; pollPromise?: Promise; confirmed?: boolean; } /** * 启动新的 QR 登录会话 * 返回可用于轮询状态的会话 ID */ export declare function startQrLoginSession(): Promise<{ sessionId: string; qrImage: string; }>; /** * 轮询 QR 登录状态 * * 使用后台轮询策略,避免前端高频调用导致请求堆积 */ export declare function pollQrLoginStatus(sessionId: string): Promise; /** * 取消并清理登录会话 */ export declare function cancelQrLoginSession(sessionId: string): void; /** * 获取登录会话 */ export declare function getQrLoginSession(sessionId: string): QrLoginSession | undefined; //# sourceMappingURL=weixin-auth.d.ts.map