/**
 * Gateway / web UI: start Weixin QR login, poll status, persist credentials (same as CLI).
 */
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;
    /** After credentials + config file are written (or login failed after wait). */
    onPersisted?: (r: {
        ok: boolean;
        accountId?: string;
        message: string;
    }) => void | Promise<void>;
};
/**
 * 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;
}>;
