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