@tarojs/taro 3.7.0-alpha.2 → 3.7.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,112 +0,0 @@
1
- import React from 'react'
2
-
3
- import Taro from './index'
4
-
5
- declare module './index' {
6
- type MessageType = 'info' | 'success' | 'error' | 'warning'
7
-
8
- interface AtMessageOptions {
9
- message: string
10
- type?: MessageType
11
- duration?: number
12
- }
13
-
14
- interface RequestParams<T=any> extends request.Option<T, any> {
15
- [propName: string]: any
16
- }
17
-
18
- interface Current {
19
- app: AppInstance | null
20
- router: RouterInfo | null
21
- page: PageInstance | null
22
- onReady: string
23
- onHide: string
24
- onShow: string
25
- preloadData?: Record<any, any>
26
- /**
27
- * RN 私有对象navigationRef,用于使用底层接口控制路由
28
- */
29
- rnNavigationRef?: React.RefObject<any>
30
- }
31
-
32
- interface SetGlobalDataPlugin {
33
- install (app: any, data: any): void
34
- }
35
-
36
- interface TARO_ENV_TYPE {
37
- [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
38
- [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
39
- [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
40
- [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
41
- [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
42
- [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
43
- [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
44
- [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
45
- }
46
-
47
- interface TaroStatic {
48
- Events: {
49
- new (): TaroGeneral.Events
50
- }
51
-
52
- /** 事件中心
53
- * @supported global
54
- */
55
- eventCenter: TaroGeneral.Events
56
-
57
- ENV_TYPE: TARO_ENV_TYPE
58
-
59
- /** 获取环境变量
60
- * @supported global
61
- */
62
- getEnv(): TaroGeneral.ENV_TYPE
63
-
64
- /** 尺寸转换
65
- * @supported global
66
- */
67
- pxTransform(size: number, designWidth?: number): string
68
-
69
- /** 尺寸转换初始化
70
- * @supported global
71
- */
72
- initPxTransform(config: {
73
- baseFontSize?: number
74
- deviceRatio?: TaroGeneral.TDeviceRatio
75
- designWidth?: number
76
- targetUnit?: string
77
- unitPrecision?: number
78
- }): void
79
-
80
- /** 小程序引用插件 JS 接口
81
- * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
82
- */
83
- requirePlugin(pluginName: string): any
84
-
85
- /** 获取当前页面实例
86
- * @supported global
87
- */
88
- getCurrentInstance(): Current
89
- Current: Current
90
-
91
- /** Vue3 插件,用于设置 `getApp()` 中的全局变量
92
- * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
93
- * @example
94
- * ```js
95
- * // 使用插件
96
- * const App = createApp(...)
97
- * App.use(setGlobalDataPlugin, {
98
- * xxx: 999
99
- * })
100
- * // 获取全局变量
101
- * Taro.getApp().xxx
102
- * ```
103
- */
104
- setGlobalDataPlugin: SetGlobalDataPlugin
105
-
106
- /** 获取自定义 TabBar 对应的 React 或 Vue 组件实例
107
- * @supported weapp
108
- * @param page 小程序页面对象,可以通过 Taro.getCurrentInstance().page 获取
109
- */
110
- getTabBar<T>(page: Current['page']): T | undefined
111
- }
112
- }