import { getActiveWebListener as getActiveWebListenerImpl } from "./active-listener.js"; import { getWebAuthAgeMs as getWebAuthAgeMsImpl, logWebSelfId as logWebSelfIdImpl, logoutWeb as logoutWebImpl, readWebSelfId as readWebSelfIdImpl, webAuthExists as webAuthExistsImpl, } from "./auth-store.js"; import { monitorWebChannel as monitorWebChannelImpl } from "./auto-reply/monitor.js"; import { loginWeb as loginWebImpl } from "./login.js"; import { whatsappSetupWizard as whatsappSetupWizardImpl } from "./setup-surface.js"; type GetActiveWebListener = typeof import("./active-listener.js").getActiveWebListener; type GetWebAuthAgeMs = typeof import("./auth-store.js").getWebAuthAgeMs; type LogWebSelfId = typeof import("./auth-store.js").logWebSelfId; type LogoutWeb = typeof import("./auth-store.js").logoutWeb; type ReadWebSelfId = typeof import("./auth-store.js").readWebSelfId; type WebAuthExists = typeof import("./auth-store.js").webAuthExists; type LoginWeb = typeof import("./login.js").loginWeb; type StartWebLoginWithQr = typeof import("./login-qr.js").startWebLoginWithQr; type WaitForWebLogin = typeof import("./login-qr.js").waitForWebLogin; type WhatsAppSetupWizard = typeof import("./setup-surface.js").whatsappSetupWizard; type MonitorWebChannel = typeof import("./auto-reply/monitor.js").monitorWebChannel; let loginQrPromise: Promise | null = null; function loadWhatsAppLoginQr() { loginQrPromise ??= import("./login-qr.js"); return loginQrPromise; } export function getActiveWebListener( ...args: Parameters ): ReturnType { return getActiveWebListenerImpl(...args); } export function getWebAuthAgeMs(...args: Parameters): ReturnType { return getWebAuthAgeMsImpl(...args); } export function logWebSelfId(...args: Parameters): ReturnType { return logWebSelfIdImpl(...args); } export function logoutWeb(...args: Parameters): ReturnType { return logoutWebImpl(...args); } export function readWebSelfId(...args: Parameters): ReturnType { return readWebSelfIdImpl(...args); } export function webAuthExists(...args: Parameters): ReturnType { return webAuthExistsImpl(...args); } export function loginWeb(...args: Parameters): ReturnType { return loginWebImpl(...args); } export async function startWebLoginWithQr( ...args: Parameters ): ReturnType { const { startWebLoginWithQr } = await loadWhatsAppLoginQr(); return await startWebLoginWithQr(...args); } export async function waitForWebLogin( ...args: Parameters ): ReturnType { const { waitForWebLogin } = await loadWhatsAppLoginQr(); return await waitForWebLogin(...args); } export const whatsappSetupWizard: WhatsAppSetupWizard = { ...whatsappSetupWizardImpl }; export function monitorWebChannel( ...args: Parameters ): ReturnType { return monitorWebChannelImpl(...args); }