1 | import Taro, { Component } from './index'
|
2 |
|
3 | declare module './index' {
|
4 | type MessageType = 'info' | 'success' | 'error' | 'warning'
|
5 |
|
6 | interface AtMessageOptions {
|
7 | message: string
|
8 | type?: MessageType
|
9 | duration?: number
|
10 | }
|
11 |
|
12 | interface RequestParams<T> extends request.Option<T, any> {
|
13 | [propName: string]: any
|
14 | }
|
15 |
|
16 | interface Current {
|
17 | app: AppInstance | null
|
18 | router: RouterInfo | null
|
19 | page: PageInstance | null
|
20 | onReady: string
|
21 | onHide: string
|
22 | onShow: string
|
23 | preloadData?: Record<any, any>
|
24 | |
25 |
|
26 |
|
27 | rnNavigationRef?: React.RefObject<any>
|
28 | }
|
29 |
|
30 | interface SetGlobalDataPlugin {
|
31 | install (app: any, data: any): void
|
32 | }
|
33 |
|
34 | interface TARO_ENV_TYPE {
|
35 | [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
|
36 | [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
|
37 | [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
|
38 | [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
|
39 | [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
|
40 | [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
|
41 | [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
|
42 | [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
|
43 | }
|
44 |
|
45 | interface TaroStatic {
|
46 | Events: {
|
47 | new (): TaroGeneral.Events
|
48 | }
|
49 |
|
50 |
|
51 | eventCenter: TaroGeneral.Events
|
52 |
|
53 | ENV_TYPE: TARO_ENV_TYPE
|
54 |
|
55 | getEnv(): TaroGeneral.ENV_TYPE
|
56 |
|
57 | render(component: Component | JSX.Element, element: Element | null): any
|
58 |
|
59 | internal_safe_set(...arg: any[]): any
|
60 | internal_safe_get(...arg: any[]): any
|
61 |
|
62 | atMessage(options: AtMessageOptions): void
|
63 |
|
64 | pxTransform(size: number, designWidth?: number): string
|
65 | initPxTransform(config: { designWidth: number; deviceRatio: TaroGeneral.TDeviceRatio }): void
|
66 |
|
67 | |
68 |
|
69 |
|
70 | requirePlugin(pluginName: string): any
|
71 |
|
72 | setIsUsingDiff (flag: boolean)
|
73 |
|
74 | Current: Current
|
75 |
|
76 | getCurrentInstance(): Current
|
77 |
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | setGlobalDataPlugin: SetGlobalDataPlugin
|
92 |
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 | getTabBar<T>(page: Current['page']): T | undefined
|
99 | }
|
100 | }
|