/*! ***************************************************************************** Copyright (c) 2022 Tencent, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***************************************************************************** */ declare namespace WechatMiniprogram.Page { type Instance< TData extends DataOption, TCustom extends CustomOption > = OptionalInterface & InstanceProperties & InstanceMethods & Data & TCustom type Options< TData extends DataOption, TCustom extends CustomOption > = (TCustom & Partial> & Partial & { options?: Component.ComponentOptions }) & ThisType> type TrivialInstance = Instance interface Constructor { ( options: Options ): void } interface ILifetime { /** 生命周期回调—监听页面加载 * * 页面加载时触发。一个页面只会调用一次,可以在 onLoad 的参数中获取打开当前页面路径中的参数。 */ onLoad( /** 打开当前页面路径中的参数 */ query: Record ): void | Promise /** 生命周期回调—监听页面显示 * * 页面显示/切入前台时触发。 */ onShow(): void | Promise /** 生命周期回调—监听页面初次渲染完成 * * 页面初次渲染完成时触发。一个页面只会调用一次,代表页面已经准备妥当,可以和视图层进行交互。 * * 注意:对界面内容进行设置的 API 如`wx.setNavigationBarTitle`,请在`onReady`之后进行。 */ onReady(): void | Promise /** 生命周期回调—监听页面隐藏 * * 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,小程序切入后台等。 */ onHide(): void | Promise /** 生命周期回调—监听页面卸载 * * 页面卸载时触发。如`redirectTo`或`navigateBack`到其他页面时。 */ onUnload(): void | Promise /** 监听用户下拉动作 * * 监听用户下拉刷新事件。 * - 需要在`app.json`的`window`选项中或页面配置中开启`enablePullDownRefresh`。 * - 可以通过`wx.startPullDownRefresh`触发下拉刷新,调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 * - 当处理完数据刷新后,`wx.stopPullDownRefresh`可以停止当前页面的下拉刷新。 */ onPullDownRefresh(): void | Promise /** 页面上拉触底事件的处理函数 * * 监听用户上拉触底事件。 * - 可以在`app.json`的`window`选项中或页面配置中设置触发距离`onReachBottomDistance`。 * - 在触发距离内滑动期间,本事件只会被触发一次。 */ onReachBottom(): void | Promise /** 用户点击右上角转发 * * 监听用户点击页面内转发按钮(`