/** * Gateway / web UI: start Weixin QR login, poll status, persist credentials (same as CLI). */ import type { Config } from "@xopcai/xopc/config/schema.js"; export type WeixinGatewayQrLoginStatus = { phase: "polling"; qrcodeUrl: string; /** Sub-state from ilink while waiting */ qrStatus?: string; } | { phase: "done"; ok: true; accountId: string; } | { phase: "done"; ok: false; message: string; } | { phase: "unknown"; message: string; }; export declare function getWeixinGatewayQrLoginStatus(sessionKey: string): WeixinGatewayQrLoginStatus; export type WeixinGatewayQrLoginStartOptions = { configPath?: string; account?: string; timeoutMs?: number; verbose?: boolean; /** Config snapshot from the already-running gateway; avoids loading the heavy config loader from Electron dynamic extension code. */ initialConfig?: Config; /** After credentials + config file are written (or login failed after wait). */ onPersisted?: (r: { ok: boolean; accountId?: string; message: string; config?: Config; }) => void | Promise; }; /** * Begin QR login and wait in the background; poll with {@link getWeixinGatewayQrLoginStatus}. */ export declare function startWeixinGatewayQrLogin(opts: WeixinGatewayQrLoginStartOptions): Promise<{ ok: true; sessionKey: string; qrcodeUrl: string; } | { ok: false; message: string; }>;