UNPKG

2.13 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps, CommonEventFunction } from './common'
3interface FunctionalPageNavigatorProps extends StandardProps {
4 /** 跳转到的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版);线上版本必须设置为 release
5 * @default "release"
6 * @supported weapp
7 */
8 version?: keyof FunctionalPageNavigatorProps.Version
9 /** 要跳转到的功能页
10 * @supported weapp
11 */
12 name?: keyof FunctionalPageNavigatorProps.Name
13 /** 功能页参数,参数格式与具体功能页相关
14 * @supported weapp
15 */
16 args?: object
17 /** 功能页返回,且操作成功时触发, detail 格式与具体功能页相关
18 * @supported weapp
19 */
20 onSuccess?: CommonEventFunction
21 /** 功能页返回,且操作失败时触发, detail 格式与具体功能页相关
22 * @supported weapp
23 */
24 onFail?: CommonEventFunction
25 /** 因用户操作从功能页返回时触发
26 * @supported weapp
27 */
28 onCancel?: CommonEventFunction
29}
30declare namespace FunctionalPageNavigatorProps {
31 /** version 的合法值 */
32 interface Version {
33 /** 开发版 */
34 develop
35 /** 体验版 */
36 trial
37 /** 正式版 */
38 release
39 }
40 /** name 的合法值 */
41 interface Name {
42 /** [用户信息功能页](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/user-info.html) */
43 loginAndGetUserInfo
44 /** [支付功能页](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/request-payment.html) */
45 requestPayment
46 /** [收货地址功能页](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/choose-address.html) */
47 chooseAddress
48 }
49}
50/** 仅在插件中有效,用于跳转到插件功能页
51 * @classification navig
52 * @supported weapp
53 * @see https://developers.weixin.qq.com/miniprogram/dev/component/functional-page-navigator.html
54 */
55declare const FunctionalPageNavigator: ComponentType<FunctionalPageNavigatorProps>
56export { FunctionalPageNavigator, FunctionalPageNavigatorProps }