import { CommonResponse } from './request'; import * as EventEmitter from 'eventemitter3'; import { ShareConfig } from './bizContainer'; export interface PathMap { home?: string; webview?: string; } export interface SystemInfoConfig { statusBarHeight?: number; } export interface Config { /** * 注入 rax-app */ raxAppUtils: any; /** * 小程序 appId */ appId: string; /** * 项目类型,枚举 */ type?: string; /** * 请求 host */ host: string; /** * 装修页面的 host,默认和 host 一样 */ bizHost?: string; /** * arms pid,不配置则没有上报 */ pid?: string; /** * 页面分享的请求地址 */ activityShareUrl?: string; /** * 小程序登录接口地址,默认 /account/login/auth/weixin/miniapp */ tokenUrl?: string; /** * 更新用户信息接口,默认 /account/auth/weixin/miniapp/updateUserInfo */ userInfoUrl?: string; /** * 更新手机号接口,默认 /account/auth/weixin/miniapp/updateUserPhone */ phoneUrl?: string; /** * 获取订阅消息 template 接口地址,默认 /account/third/listSubscribeMessage */ messageUrl?: string; /** * 订阅消息成功的通知接口地址,默认 /account/third/subscribeMessage */ messageSubUrl?: string; /** * 请求装修页面列表,默认 /pagePath */ decoratePagesUrl?: string; /** * 请求装修页面数据,默认 /render/page */ decorateRenderUrl?: string; /** * 请求装修页面预览数据,默认 /render/previewPage */ decoratePreviewUrl?: string; /** * 授权时的组件 */ AuthComponent?: Function; /** * 授权时的图片链接,默认 * @TODO 集合授权参数 */ authImage?: string; /** * 授权用户信息时的文案,默认 微信一键授权登录 */ authInfoText?: string; /** * 授权用户信息时的取消按钮文案,默认 暂不登录 */ authInfoCancelText?: string; /** * 授权手机号时的文案,默认 绑定手机 */ authPhoneText?: string; /** * 授权手机号时的按钮文案,默认 暂不验证 */ authPhoneCancelText?: string; /** * 授权时的弹窗类型,全屏 or 弹窗,默认 fullscreen */ authShowType?: 'fullscreen' | 'dialog'; /** * 路由表 */ pathMap: PathMap; /** * tabbar 的页面 pageType 数组,@TODO 不传可以不 */ tabbarPages?: string[]; /** * 消息订阅的所有 code,如果不传则代表不进行消息订阅 */ eventCodeList?: string[]; /** * 是否调用接口获取分享信息,默认 false */ getShareInfo?: boolean; /** * 页面 onShow 时调用 */ onPageShow?: Function; /** * 页面 onLoad 钩子 */ onPageLoad?: Function; /** * 页面 onHide 时调用 */ onPageHide?: Function; /** * 页面分享时调用 */ onPageShare?: Function; /** * 页面渲染错误组件 */ ErrorView?: Function; /** * 页面调试组件,会在容器层面渲染出来 */ DebugView?: Function; /** * @TODO 集合埋点参数 * 友盟埋点 appKey */ umaAppKey?: string; /** * 微信配置,覆盖上面的配置项 */ wechat?: Config; /** * 字节配置,覆盖上面的配置项 */ tt?: Config; /** * web 配置 */ web?: Config; /** * 自定义 request 方法,默认是 @uni/request */ requestLib?: Function; /** * 奥创方法回调 */ responseTransform?: Function; /** * 奥创接口请求头 */ oltronHeaders?: object; /** * 请求超时事件 */ timeout: number; } interface Env { envList?: string[]; baseConfig?: Config; } interface getShareParams { page: string; path: string; url?: string; } interface ShareResponse extends CommonResponse { result: ShareConfig; } export declare let pageConfig: any; export declare const eventListener: EventEmitter; export declare function getUniversalConst(): Config; export declare let universalConst: Config; /** * 初始化项目配置 * @param env */ export declare function initEnv(env: Env | Config): void; export declare function setConfig(config: Config): void; export declare function initSubscribe(code?: [], messageUrl?: string): void; export declare const subscribeMessage: (params: any) => void; export declare const getPageConfig: () => Promise; export declare function asyncGetPageConfig(): Promise; export declare function getPageShareMaterial(config: getShareParams): Promise; export declare const getNavBarHeight: () => any; export declare const deleteEmptyValue: (obj: any) => any; export {};