/** * h5 tcb 模块, 负责tcb的连接和认证相关处理 * @cloudbase/js-sdk 为 peerDependencies, 仅 h5 入口需要, 小程序不需要 */ import tcb from '@cloudbase/js-sdk'; import { IWedaHostUser, ILoginState } from '../types'; declare global { interface Window { _WedaHostConfig: { loginConfig?: { failurePolicy?: 'anonymous_login'; needSignIn?: boolean; }; wedaUser?: IWedaHostUser; appType?: 'portal'; login?: (params?: { app: tcb.app.App; auth: any; }) => void; forceLogin?: boolean; tcbInstance?: tcb.app.App; }; tcbAdapterPrivatelink: any; } } export declare function getCustomWedaConfig(): { loginConfig?: { failurePolicy?: "anonymous_login" | undefined; needSignIn?: boolean | undefined; } | undefined; wedaUser?: IWedaHostUser | undefined; appType?: "portal" | undefined; login?: ((params?: { app: tcb.app.App; auth: any; loginState: ILoginState; defaultLogin: () => void; } | undefined) => void) | undefined; forceLogin?: boolean | undefined; tcbInstance?: tcb.app.App | undefined; }; /** * 获取 tcb 实例, 不进行登录操作 * @returns {Promise<{app: tcb.app.App, auth: tcb.auth.Auth}>} */ export declare function getTcbInstance(): Promise<{ app: tcb.app.App; auth: tcb.auth.App; }>; /** * 获取登录状态, 兼容js-sdk 1.0 和 2.0 用法 */ export declare function getLoginState(): Promise;