import Vnmf from '../../../index' declare module '../../../index' { namespace onPageNotFound { interface Result { /** Is the first page launched this time? (For example, come in from sharing and wait ,The first page is the sharing page of the developer configuration ) */ isEntryPage: boolean /** There is no path to the page */ path: string /** Open the page that does not exist query parameter */ query: VnmfGeneral.IAnyObject } /** The pages to be opened by the applet do not exist in the event callback function */ type Callback = (res: Result) => void } namespace onError { /** The callback function of the mini -program error event */ type Callback = ( /** Error message ,Containing stacks */ error: string, ) => void } namespace onAppShow { interface CallbackResult { /** The path of the small program cut the front desk */ path: string /** The small program cuts the front desk query parameter */ query: VnmfGeneral.IAnyObject /** shareTicket,For details [Get more forwarding information ](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ shareTicket: string /** The small program cuts the front desk [Scene value ](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */ scene: number /** Source information 。From another small program 、Public account or App Back when entering the applet 。Otherwise, return `{}`。(Please note later ) */ referrerInfo: ResultReferrerInfo /** Open file information array ,Only open from the chat material scene (scenefor 1173)Only to carry this parameter */ forwardMaterials?: ForwardMaterial[] /** Chat from WeChat group /When you open the applet alone ,chatType Express the specific WeChat group chat /Single chat */ chatType?: keyof ChatType /** API category */ apiCategory?: keyof ApiCategory } /** Source information 。From another small program 、Public account or App Back when entering the applet 。Otherwise, return `{}`。(Please note later ) */ interface ResultReferrerInfo { /** Source applet 、Public account or App of appId */ appId?: string /** Data from the source applet passed by ,scene=1037or 1038Timely support */ extraData?: VnmfGeneral.IAnyObject } /** ChatType Type legal value */ interface ForwardMaterial { /** File mimetypetype */ type: string /** file name */ name: string /** file path (in the case of webviewThat is url) */ path: string /** File size */ size: number } /** ChatType Type legal value */ interface ChatType { /** WeChat contact single chat */ 1 /** Corporate WeChat contact single chat */ 2 /** Ordinary WeChat group chat */ 3 /** Enterprise WeChat mutual communication group chat */ 4 } /** API Category legal value */ interface ApiCategory { /** Default category */ default /** Native functional ,Live broadcast product 、Application of commodity window and other scenarios */ nativeFunctionalized /** Only browse ,The applets of the scene of the circle of friends are open */ browseOnly /** Embedded ,The applet that opens the half -screen applet capability */ embedded } } namespace onUnhandledRejection { type Callback = (res: Result) => void type Result = { /** Denial Reason ,Generally one Error Object */ reason: string | Error /** Rejected Promise Object */ promise: Promise } } namespace onThemeChange { /** The system theme changes the callback function of the event */ type Callback = (res: Result) => void interface Result { /** The current theme of the system ,Value `light`or `dark` */ theme: keyof ITheme } interface ITheme { /** Light -colored theme */ light /** Dark theme */ dark } } interface VnmfStatic { /** Unprocessed Promise Refuse incident 。The incident and [`App.onUnhandledRejection`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onUnhandledRejection-Object-object) The timing of callback is consistent with the parameters 。 * * **Notice ** * - all unhandledRejection Can be captured by this monitoring ,Only Error The type will trigger the alarm in the small program background 。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html */ onUnhandledRejection(callback: onUnhandledRejection.Callback): void /** The theme of the monitoring system changes the event 。The incident and [`App.onThemeChange`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onThemeChange-Object-object) The timing of callback is consistent 。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onThemeChange.html */ onThemeChange(callback: onThemeChange.Callback): void /** * There are no events to open the pages to be opened by listening to the applet 。The incident and [`App.onPageNotFound`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onpagenotfoundobject-object) The timing of callback is consistent 。 * * **Notice ** * - Developers can retract the page during the callback ,But must **Synchronize **deal with ,Asynchronous (E.g `setTimeout` Asynchronous execution )invalid 。 * - If the developer did not call [Vnmf.onPageNotFound](/docs/apis/base/weapp/app-event/onPageNotFound) Binding monitoring ,No statement `App.onPageNotFound`,When the jump page does not exist ,There will be no prompt page to push into the WeChat client native page 。 * - If you return to another unwanted page in the callback ,There will be no prompt page to push into the WeChat client native page ,And no longer call back for the second time 。 * @supported weapp, h5, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html */ onPageNotFound(callback: onPageNotFound.Callback): void /** Monitoring mini -program error event 。Such as a script error or API Call an error, etc. 。The incident and [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) The timing of callback is consistent with the parameters 。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html */ onError(callback: onError.Callback): void /** * Survival audio interrupt ending incident 。Receive onAudioInterruptionBegin After the incident ,All audio in the applet will be suspended ,After receiving this incident, you can play it again * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionEnd.html */ onAudioInterruptionEnd ( /** Audio interrupt ending incident callback function */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** * Survival audio was interrupted due to the system occupation of the system 。The following scene will trigger this incident :Alarm clock 、Telephone 、FaceTime call 、WeChat voice chat 、WeChat video chat 。After triggering this incident ,All audio in the applet will be suspended 。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionBegin.html */ onAudioInterruptionBegin( /** Audio is interrupted by the system to start the event recovery function due to the system occupation */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** Surveillance applet Cut the front desk event 。The incident and [`App.onShow`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onshowobject-object) The callback parameters are the same 。 * * **Return effective referrerInfo Scene ** * * | Scene value | Scenes | appIdmeaning | * | ------ | ------------------------------- | ---------- | * | 1020 | the public profile Page related applet list | Source public account | * | 1035 | Public account custom menu | Source public account | * | 1036 | App Share message card | source App | * | 1037 | The applet opens the applet | Source applet | * | 1038 | Return from another applet | Source applet | * | 1043 | Public number template message | Source public account | * * **Notice ** * * Some versions are none `referrerInfo`Will return when `undefined`,Suggestion `options.referrerInfo && options.referrerInfo.appId` Judgment 。 * @supported weapp, h5, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppShow.html */ onAppShow( /** The recovery function of the small program cutting the front desk */ callback: (result: onAppShow.CallbackResult) => void, ): void /** Surveillance mini -program cutting background incident 。The incident and [`App.onHide`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onhide) The timing of callback is consistent 。 * @supported weapp, h5, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppHide.html */ onAppHide( /** The recovery function of the small program cutting background events */ callback: (res: onAppShow.CallbackResult) => void, ): void /** Cancel the unprecedented monitoring Promise Refuse incident * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html */ offUnhandledRejection(callback: onUnhandledRejection.Callback): void /** Cancel the theme of the monitoring system to change the event * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offThemeChange.html */ offThemeChange(callback: onThemeChange.Callback): void /** There is no event to cancel the pages to be opened by the monitoring applet * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html */ offPageNotFound( /** The pages to be opened by the applet do not exist in the event callback function */ callback: (res: onPageNotFound.Callback) => void, ): void /** Cancel the incorrect incident of listening audio playback errors * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html */ offError( /** Audio playback function recovery function */ callback: (res: onError.Callback) => void, ): void /** Cancel the end of the listening audio interrupt ending * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAudioInterruptionEnd.html */ offAudioInterruptionEnd( /** Audio interrupt ending incident callback function */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** Cancellation of the listening audio was interrupted by the system occupied by the system, and the start event was interrupted * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAudioInterruptionBegin.html */ offAudioInterruptionBegin( /** Audio is interrupted by the system to start the event recovery function due to the system occupation */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** Cancel the incident of the front desk of listening mini -programs * @supported weapp, h5, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html */ offAppShow( /** The recovery function of the small program cutting the front desk */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** Cancel the incident in the background of the monitoring applet * @supported weapp, h5, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppHide.html */ offAppHide( /** The recovery function of the small program cutting background events */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void } }