UNPKG

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