import Vnmf from '../../index' declare module '../../index' { namespace switchTab { interface Option { /** You need to jump. tabBar Path to page(Yes, it is. app.json It's... it's... [tabBar](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabbar) Field-defined page),Unable to bring parameters after path。 */ url: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace reLaunch { interface Option { /** Inline page path for the application that needs to jump,You can bring parameters after the path。Use between parameters and paths?Separating,Parameter Keys and Values=Connect,Use of different parameters&Separating;Like 'path?key=value&key2=value2' */ url: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace redirectTo { interface Option { /** The infraction of the application that needs to jump tabBar Path to page(s), You can bring parameters after the path。Use between parameters and paths `?` Separating,Parameter Keys and Values `=` Connect,Use of different parameters `&` Separating;Like 'path?key=value&key2=value2' */ url: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace navigateTo { interface Option { /** The infraction of the application that needs to jump tabBar Path to page(s), You can bring parameters after the path。Use between parameters and paths `?` Separating,Parameter Keys and Values `=` Connect,Use of different parameters `&` Separating;Like 'path?key=value&key2=value2' */ url: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Inter-Page Communication Interface,The data used to listen the open page sent current。 */ events?: VnmfGeneral.IAnyObject /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult & { eventChannel: EventChannel }) => void } } namespace navigateBack { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Number of pages returned,If... delta More than the number of pages available,returns to the first page。 */ delta?: number /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } /** Inter-Page Event Communication Channel * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.html */ interface EventChannel { /** Trigger an event * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.emit.html */ emit( /** Event Name */ eventName: string, /** Event Parameters */ ...args: any ): void /** Keep listening to an event. * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.on.html */ on( /** Event Name */ eventName: string, /** Event listening function */ fn: VnmfGeneral.EventCallback, ): void /** Listen to an incident once.,Deactivation after triggering * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.once.html */ once( /** Event Name */ eventName: string, /** Event listening function */ fn: VnmfGeneral.EventCallback, ): void /** Cancel listening to an event。When giving the second parameter,Just cancel the given listening function,Otherwise, we'll cancel all listening functions. * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.off.html */ off( /** Event Name */ eventName: string, /** Event listening function */ fn: VnmfGeneral.EventCallback, ): void } interface VnmfStatic { /** Jump to tabBar Page,♪ And close all other non- tabBar Page * @supported weapp, h5, rn, tt * @example * ```json * { * "tabBar": { * "list": [{ * "pagePath": "index", * "text": "Home Page" * },{ * "pagePath": "other", * "text": "Other" * }] * } * } * ``` * * ```tsx * Vnmf.switchTab({ * url: '/index' * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html */ switchTab(option: switchTab.Option): Promise /** Close All Pages,Open to a page in application * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.reLaunch({ * url: 'test?id=1' * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.reLaunch.html */ reLaunch(option: reLaunch.Option): Promise /** Close the current page,Jump to a page in application。But it's not allowed to jump. tabbar Page。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.redirectTo({ * url: 'test?id=1' * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.redirectTo.html */ redirectTo(option: redirectTo.Option): Promise /** Keep the current page,Jump to a page in application。But you can't jump to it. tabbar Page。Use Vnmf.navigateBack You can return to the original page。Applets up to 10 floors。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.navigateTo({ * url: 'test?id=1', * events: { * // Add a listening device to the specified event,Get data that has been sent to the current page on open * acceptDataFromOpenedPage: function(data) { * console.log(data) * }, * someEvent: function(data) { * console.log(data) * } * ... * }, * success: function (res) { * // ThrougheventChannelSend data to open pages * res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' }) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html */ navigateTo(option: navigateTo.Option): Promise /** Close the current page,Returns previous page or multilevel。Through getCurrentPages Retrieve the current pavilion,It's decided how many floors to return.。 * @supported weapp, h5, rn, tt * @example * ```tsx * // Attention.:Call navigateTo Jumping,Pages calling this method will be added to the stack,And... redirectTo The method won't.。See example code below * // Here it is.APage * Vnmf.navigateTo({ * url: 'B?id=1' * }) * // Here it is.BPage * Vnmf.navigateTo({ * url: 'C?id=1' * }) * // Yes.CPage navigateBack,Will returnAPage * Vnmf.navigateBack({ * delta: 2 * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html */ navigateBack(option?: navigateBack.Option): Promise } }