/// declare var __wxConfig: string interface IAppOption { globalData: { userInfo?: WechatMiniprogram.UserInfo token?: string lastLoginTime?: number env?: string showcateid?: number } userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback } interface IRestResult { result: T code: number } interface EventDetail { detail: T } interface PagedResultDto extends ListResultDto { totalCount: number } interface ListResultDto { items: T[] } interface TabBarChangeEvent extends EventDetail<{ value: string | number }> {} declare namespace WxGeneral { type IAnyObject = Record type EventCallback = ( /** 触发事件参数 */ ...args: any ) => void interface CallbackResult { /** 错误信息 */ errMsg: string } interface EventChannel { /** 触发一个事件 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.emit.html */ emit( /** 事件名称 */ eventName: string, /** 事件参数 */ ...args: any ): void /** 持续监听一个事件 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.on.html */ on( /** 事件名称 */ eventName: string, /** 事件监听函数 */ fn: EventCallback, ): void /** 监听一个事件一次,触发后失效 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.once.html */ once( /** 事件名称 */ eventName: string, /** 事件监听函数 */ fn: EventCallback, ): void /** 取消监听一个事件。给出第二个参数时,只取消给出的监听函数,否则取消所有监听函数 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.off.html */ off( /** 事件名称 */ eventName: string, /** 事件监听函数 */ fn: EventCallback, ): void } } declare namespace switchTab { interface Option { /** 需要跳转的 tabBar 页面的路径(需在 app.json 的 [tabBar](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabbar) 字段定义的页面),路径后不能带参数。 */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (res: WxGeneral.CallbackResult) => void /** 接口调用失败的回调函数 */ fail?: (res: WxGeneral.CallbackResult) => void /** 接口调用成功的回调函数 */ success?: (res: WxGeneral.CallbackResult) => void } } declare namespace reLaunch { interface Option { /** 需要跳转的应用内页面路径,路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (res: WxGeneral.CallbackResult) => void /** 接口调用失败的回调函数 */ fail?: (res: WxGeneral.CallbackResult) => void /** 接口调用成功的回调函数 */ success?: (res: WxGeneral.CallbackResult) => void } } declare namespace redirectTo { interface Option { /** 需要跳转的应用内非 tabBar 的页面的路径, 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (res: WxGeneral.CallbackResult) => void /** 接口调用失败的回调函数 */ fail?: (res: WxGeneral.CallbackResult) => void /** 接口调用成功的回调函数 */ success?: (res: WxGeneral.CallbackResult) => void } } declare namespace navigateTo { interface Option { /** 需要跳转的应用内非 tabBar 的页面的路径, 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (res: WxGeneral.CallbackResult) => void /** 页面间通信接口,用于监听被打开页面发送到当前页面的数据。 */ events?: WxGeneral.IAnyObject /** 接口调用失败的回调函数 */ fail?: (res: WxGeneral.CallbackResult) => void /** 接口调用成功的回调函数 */ success?: (res: WxGeneral.CallbackResult & { eventChannel: WxGeneral.EventChannel }) => void } } declare namespace navigateBack { interface Option { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: (res: WxGeneral.CallbackResult) => void /** 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 */ delta?: number /** 接口调用失败的回调函数 */ fail?: (res: WxGeneral.CallbackResult) => void /** 接口调用成功的回调函数 */ success?: (res: WxGeneral.CallbackResult) => void } }