@spcsn/taro 0.1.0
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.
- package/README.md +12 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/index.js +9 -0
- package/package.json +86 -0
- package/types/api/ad/index.d.ts +197 -0
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/inference.d.ts +129 -0
- package/types/api/ai/visionkit.d.ts +874 -0
- package/types/api/alipay/index.d.ts +69 -0
- package/types/api/base/crypto.d.ts +104 -0
- package/types/api/base/debug.d.ts +329 -0
- package/types/api/base/env.d.ts +19 -0
- package/types/api/base/index.d.ts +102 -0
- package/types/api/base/performance.d.ts +258 -0
- package/types/api/base/system.d.ts +742 -0
- package/types/api/base/update.d.ts +130 -0
- package/types/api/base/weapp/app-event.d.ts +265 -0
- package/types/api/base/weapp/life-cycle.d.ts +155 -0
- package/types/api/canvas/index.d.ts +2162 -0
- package/types/api/cloud/index.d.ts +2622 -0
- package/types/api/data-analysis/index.d.ts +122 -0
- package/types/api/device/accelerometer.d.ts +102 -0
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +46 -0
- package/types/api/device/bluetooth-ble.d.ts +601 -0
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +463 -0
- package/types/api/device/calendar.d.ts +98 -0
- package/types/api/device/clipboard.d.ts +81 -0
- package/types/api/device/compass.d.ts +105 -0
- package/types/api/device/contact.d.ts +110 -0
- package/types/api/device/gyroscope.d.ts +85 -0
- package/types/api/device/iBeacon.d.ts +168 -0
- package/types/api/device/keyboard.d.ts +97 -0
- package/types/api/device/memory.d.ts +52 -0
- package/types/api/device/motion.d.ts +88 -0
- package/types/api/device/network.d.ts +172 -0
- package/types/api/device/nfc.d.ts +1238 -0
- package/types/api/device/phone.d.ts +30 -0
- package/types/api/device/scan.d.ts +111 -0
- package/types/api/device/screen.d.ts +217 -0
- package/types/api/device/sms.d.ts +26 -0
- package/types/api/device/vibrate.d.ts +51 -0
- package/types/api/device/wifi.d.ts +301 -0
- package/types/api/ext/index.d.ts +64 -0
- package/types/api/files/index.d.ts +1472 -0
- package/types/api/framework/index.d.ts +51 -0
- package/types/api/location/index.d.ts +517 -0
- package/types/api/media/audio.d.ts +1013 -0
- package/types/api/media/background-audio.d.ts +291 -0
- package/types/api/media/camera.d.ts +207 -0
- package/types/api/media/editor.d.ts +239 -0
- package/types/api/media/image.d.ts +469 -0
- package/types/api/media/live.d.ts +461 -0
- package/types/api/media/map.d.ts +638 -0
- package/types/api/media/media-recorder.d.ts +117 -0
- package/types/api/media/recorder.d.ts +317 -0
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +84 -0
- package/types/api/media/video.d.ts +527 -0
- package/types/api/media/voip.d.ts +393 -0
- package/types/api/navigate/index.d.ts +327 -0
- package/types/api/network/download.d.ts +173 -0
- package/types/api/network/mdns.d.ts +191 -0
- package/types/api/network/request.d.ts +480 -0
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +218 -0
- package/types/api/network/upload.d.ts +201 -0
- package/types/api/network/websocket.d.ts +383 -0
- package/types/api/open-api/account.d.ts +51 -0
- package/types/api/open-api/address.d.ts +68 -0
- package/types/api/open-api/authorize.d.ts +80 -0
- package/types/api/open-api/card.d.ts +110 -0
- package/types/api/open-api/channels.d.ts +225 -0
- package/types/api/open-api/customer-service.d.ts +45 -0
- package/types/api/open-api/device-voip.d.ts +103 -0
- package/types/api/open-api/facial.d.ts +98 -0
- package/types/api/open-api/favorites.d.ts +101 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +87 -0
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +115 -0
- package/types/api/open-api/my-miniprogram.d.ts +28 -0
- package/types/api/open-api/privacy.d.ts +107 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +174 -0
- package/types/api/open-api/soter.d.ts +184 -0
- package/types/api/open-api/sticker.d.ts +83 -0
- package/types/api/open-api/subscribe-message.d.ts +305 -0
- package/types/api/open-api/user-info.d.ts +182 -0
- package/types/api/open-api/werun.d.ts +101 -0
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/qq/index.d.ts +354 -0
- package/types/api/route/index.d.ts +324 -0
- package/types/api/share/index.d.ts +354 -0
- package/types/api/skyline/index.d.ts +345 -0
- package/types/api/storage/background-fetch.d.ts +131 -0
- package/types/api/storage/cache-manager.d.ts +249 -0
- package/types/api/storage/index.d.ts +405 -0
- package/types/api/swan/bookshelf.d.ts +307 -0
- package/types/api/swan/download-package.d.ts +80 -0
- package/types/api/swan/index.d.ts +251 -0
- package/types/api/swan/pay.d.ts +139 -0
- package/types/api/taro.extend.d.ts +233 -0
- package/types/api/taro.hooks.d.ts +148 -0
- package/types/api/ui/animation.d.ts +427 -0
- package/types/api/ui/background.d.ts +69 -0
- package/types/api/ui/custom-component.d.ts +23 -0
- package/types/api/ui/fonts.d.ts +77 -0
- package/types/api/ui/interaction.d.ts +281 -0
- package/types/api/ui/menu.d.ts +29 -0
- package/types/api/ui/navigation-bar.d.ts +130 -0
- package/types/api/ui/pull-down-refresh.d.ts +50 -0
- package/types/api/ui/scroll.d.ts +114 -0
- package/types/api/ui/sticky.d.ts +32 -0
- package/types/api/ui/tab-bar.d.ts +196 -0
- package/types/api/ui/window.d.ts +71 -0
- package/types/api/worker/index.d.ts +83 -0
- package/types/api/wxml/index.d.ts +540 -0
- package/types/compile/compiler.d.ts +32 -0
- package/types/compile/config/h5.d.ts +134 -0
- package/types/compile/config/harmony.d.ts +118 -0
- package/types/compile/config/index.d.ts +8 -0
- package/types/compile/config/manifest.d.ts +155 -0
- package/types/compile/config/mini.d.ts +118 -0
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/project.d.ts +338 -0
- package/types/compile/config/rn.d.ts +85 -0
- package/types/compile/config/util.d.ts +179 -0
- package/types/compile/hooks.d.ts +13 -0
- package/types/compile/index.d.ts +11 -0
- package/types/compile/viteCompilerContext.d.ts +167 -0
- package/types/global.d.ts +428 -0
- package/types/index.d.ts +190 -0
- package/types/taro.api.d.ts +130 -0
- package/types/taro.component.d.ts +168 -0
- package/types/taro.config.d.ts +712 -0
- package/types/taro.lifecycle.d.ts +220 -0
- package/types/taro.runtime.d.ts +9 -0
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
namespace openSystemBluetoothSetting {
|
|
5
|
+
interface Option {
|
|
6
|
+
/** 接口调用成功的回调函数 */
|
|
7
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
8
|
+
/** 接口调用失败的回调函数 */
|
|
9
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
10
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
11
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
namespace openAppAuthorizeSetting {
|
|
16
|
+
interface Option {
|
|
17
|
+
/** 接口调用成功的回调函数 */
|
|
18
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
19
|
+
/** 接口调用失败的回调函数 */
|
|
20
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
21
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
22
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
namespace getWindowInfo {
|
|
27
|
+
interface Result {
|
|
28
|
+
/** 设备像素比 */
|
|
29
|
+
pixelRatio: number
|
|
30
|
+
/** 屏幕宽度,单位px */
|
|
31
|
+
screenWidth: number
|
|
32
|
+
/** 屏幕高度,单位px */
|
|
33
|
+
screenHeight: number
|
|
34
|
+
/** 可使用窗口宽度,单位px */
|
|
35
|
+
windowWidth: number
|
|
36
|
+
/** 可使用窗口高度,单位px */
|
|
37
|
+
windowHeight: number
|
|
38
|
+
/** 状态栏的高度,单位px */
|
|
39
|
+
statusBarHeight?: number
|
|
40
|
+
/** 在竖屏正方向下的安全区域 */
|
|
41
|
+
safeArea?: TaroGeneral.SafeAreaResult
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
namespace getSystemSetting {
|
|
46
|
+
interface Result {
|
|
47
|
+
/** 蓝牙的系统开关 */
|
|
48
|
+
bluetoothEnabled?: boolean
|
|
49
|
+
/** 地理位置的系统开关 */
|
|
50
|
+
locationEnabled?: boolean
|
|
51
|
+
/** Wi-Fi 的系统开关 */
|
|
52
|
+
wifiEnabled?: boolean
|
|
53
|
+
/** 设备方向 */
|
|
54
|
+
deviceOrientation?: keyof DeviceOrientation
|
|
55
|
+
}
|
|
56
|
+
/** 设备方向合法值 */
|
|
57
|
+
interface DeviceOrientation {
|
|
58
|
+
/** 竖屏 */
|
|
59
|
+
portrait
|
|
60
|
+
/** 横屏 */
|
|
61
|
+
landscape
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
namespace getSystemInfoSync {
|
|
66
|
+
interface Result {
|
|
67
|
+
/** 设备品牌 */
|
|
68
|
+
brand: string
|
|
69
|
+
/** 设备型号 */
|
|
70
|
+
model: string
|
|
71
|
+
/** 设备像素比 */
|
|
72
|
+
pixelRatio: number
|
|
73
|
+
/** 屏幕宽度,单位px */
|
|
74
|
+
screenWidth: number
|
|
75
|
+
/** 屏幕高度,单位px */
|
|
76
|
+
screenHeight: number
|
|
77
|
+
/** 可使用窗口宽度,单位px */
|
|
78
|
+
windowWidth: number
|
|
79
|
+
/** 可使用窗口高度,单位px */
|
|
80
|
+
windowHeight: number
|
|
81
|
+
/** 状态栏的高度,单位px */
|
|
82
|
+
statusBarHeight?: number
|
|
83
|
+
/** 微信设置的语言 */
|
|
84
|
+
language: string
|
|
85
|
+
/** 微信版本号 */
|
|
86
|
+
version?: string
|
|
87
|
+
/** 操作系统及版本 */
|
|
88
|
+
system: string
|
|
89
|
+
/** 客户端平台 */
|
|
90
|
+
platform: string
|
|
91
|
+
/** 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */
|
|
92
|
+
fontSizeSetting?: number
|
|
93
|
+
/** 客户端基础库版本 */
|
|
94
|
+
SDKVersion?: string
|
|
95
|
+
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
96
|
+
benchmarkLevel: number
|
|
97
|
+
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
98
|
+
albumAuthorized?: boolean
|
|
99
|
+
/** 允许微信使用摄像头的开关 */
|
|
100
|
+
cameraAuthorized?: boolean
|
|
101
|
+
/** 允许微信使用定位的开关 */
|
|
102
|
+
locationAuthorized?: boolean
|
|
103
|
+
/** 允许微信使用麦克风的开关 */
|
|
104
|
+
microphoneAuthorized?: boolean
|
|
105
|
+
/** 允许微信通知的开关 */
|
|
106
|
+
notificationAuthorized?: boolean
|
|
107
|
+
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
108
|
+
notificationAlertAuthorized?: boolean
|
|
109
|
+
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
110
|
+
notificationBadgeAuthorized?: boolean
|
|
111
|
+
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
112
|
+
notificationSoundAuthorized?: boolean
|
|
113
|
+
/** 允许微信使用日历的开关 */
|
|
114
|
+
phoneCalendarAuthorized?: boolean
|
|
115
|
+
/** 蓝牙的系统开关 */
|
|
116
|
+
bluetoothEnabled?: boolean
|
|
117
|
+
/** 地理位置的系统开关 */
|
|
118
|
+
locationEnabled?: boolean
|
|
119
|
+
/** Wi-Fi 的系统开关 */
|
|
120
|
+
wifiEnabled?: boolean
|
|
121
|
+
/** 在竖屏正方向下的安全区域 */
|
|
122
|
+
safeArea?: TaroGeneral.SafeAreaResult
|
|
123
|
+
/** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */
|
|
124
|
+
locationReducedAccuracy?: boolean
|
|
125
|
+
/** 系统当前主题,取值为light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) */
|
|
126
|
+
theme?: keyof Theme
|
|
127
|
+
/** 当前小程序运行的宿主环境 */
|
|
128
|
+
host?: Host
|
|
129
|
+
/** 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 */
|
|
130
|
+
enableDebug?: boolean
|
|
131
|
+
/** 设备方向 */
|
|
132
|
+
deviceOrientation?: keyof DeviceOrientation
|
|
133
|
+
/** 小程序当前运行环境 */
|
|
134
|
+
environment?: string
|
|
135
|
+
/**
|
|
136
|
+
* 仅支付宝小程序生效
|
|
137
|
+
* screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
|
|
138
|
+
* https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
|
|
139
|
+
* 单位: px
|
|
140
|
+
* */
|
|
141
|
+
screen?: {
|
|
142
|
+
/** 屏幕宽度 */
|
|
143
|
+
width: number
|
|
144
|
+
/** 屏幕高度 */
|
|
145
|
+
height: number
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/** 系统主题合法值 */
|
|
149
|
+
interface Theme {
|
|
150
|
+
/** 深色主题 */
|
|
151
|
+
dark
|
|
152
|
+
/** 浅色主题 */
|
|
153
|
+
light
|
|
154
|
+
}
|
|
155
|
+
interface Host {
|
|
156
|
+
/** 宿主 app 对应的 appId */
|
|
157
|
+
appId: string
|
|
158
|
+
}
|
|
159
|
+
/** 设备方向合法值 */
|
|
160
|
+
interface DeviceOrientation {
|
|
161
|
+
/** 竖屏 */
|
|
162
|
+
portrait
|
|
163
|
+
/** 横屏 */
|
|
164
|
+
landscape
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
namespace getSystemInfoAsync {
|
|
169
|
+
interface Option {
|
|
170
|
+
/** 接口调用成功的回调函数 */
|
|
171
|
+
success?: (res: Result) => void
|
|
172
|
+
/** 接口调用失败的回调函数 */
|
|
173
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
174
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
175
|
+
complete?: (res: TaroGeneral.CallbackResult | Result) => void
|
|
176
|
+
}
|
|
177
|
+
interface Result extends TaroGeneral.CallbackResult {
|
|
178
|
+
/** 设备品牌 */
|
|
179
|
+
brand: string
|
|
180
|
+
/** 设备型号 */
|
|
181
|
+
model: string
|
|
182
|
+
/** 设备像素比 */
|
|
183
|
+
pixelRatio: number
|
|
184
|
+
/** 屏幕宽度,单位px */
|
|
185
|
+
screenWidth: number
|
|
186
|
+
/** 屏幕高度,单位px */
|
|
187
|
+
screenHeight: number
|
|
188
|
+
/** 可使用窗口宽度,单位px */
|
|
189
|
+
windowWidth: number
|
|
190
|
+
/** 可使用窗口高度,单位px */
|
|
191
|
+
windowHeight: number
|
|
192
|
+
/** 状态栏的高度,单位px */
|
|
193
|
+
statusBarHeight?: number
|
|
194
|
+
/** 微信设置的语言 */
|
|
195
|
+
language: string
|
|
196
|
+
/** 微信版本号 */
|
|
197
|
+
version?: string
|
|
198
|
+
/** 操作系统及版本 */
|
|
199
|
+
system: string
|
|
200
|
+
/** 客户端平台 */
|
|
201
|
+
platform: string
|
|
202
|
+
/** 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */
|
|
203
|
+
fontSizeSetting?: number
|
|
204
|
+
/** 客户端基础库版本 */
|
|
205
|
+
SDKVersion?: string
|
|
206
|
+
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
207
|
+
benchmarkLevel: number
|
|
208
|
+
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
209
|
+
albumAuthorized?: boolean
|
|
210
|
+
/** 允许微信使用摄像头的开关 */
|
|
211
|
+
cameraAuthorized?: boolean
|
|
212
|
+
/** 允许微信使用定位的开关 */
|
|
213
|
+
locationAuthorized?: boolean
|
|
214
|
+
/** 允许微信使用麦克风的开关 */
|
|
215
|
+
microphoneAuthorized?: boolean
|
|
216
|
+
/** 允许微信通知的开关 */
|
|
217
|
+
notificationAuthorized?: boolean
|
|
218
|
+
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
219
|
+
notificationAlertAuthorized?: boolean
|
|
220
|
+
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
221
|
+
notificationBadgeAuthorized?: boolean
|
|
222
|
+
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
223
|
+
notificationSoundAuthorized?: boolean
|
|
224
|
+
/** 允许微信使用日历的开关 */
|
|
225
|
+
phoneCalendarAuthorized?: boolean
|
|
226
|
+
/** 蓝牙的系统开关 */
|
|
227
|
+
bluetoothEnabled?: boolean
|
|
228
|
+
/** 地理位置的系统开关 */
|
|
229
|
+
locationEnabled?: boolean
|
|
230
|
+
/** Wi-Fi 的系统开关 */
|
|
231
|
+
wifiEnabled?: boolean
|
|
232
|
+
/** 在竖屏正方向下的安全区域 */
|
|
233
|
+
safeArea?: TaroGeneral.SafeAreaResult
|
|
234
|
+
/** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */
|
|
235
|
+
locationReducedAccuracy?: boolean
|
|
236
|
+
/** 系统当前主题,取值为light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) */
|
|
237
|
+
theme?: keyof Theme
|
|
238
|
+
/** 当前小程序运行的宿主环境 */
|
|
239
|
+
host?: Host
|
|
240
|
+
/** 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 */
|
|
241
|
+
enableDebug?: boolean
|
|
242
|
+
/** 设备方向 */
|
|
243
|
+
deviceOrientation?: keyof DeviceOrientation
|
|
244
|
+
/** 小程序当前运行环境 */
|
|
245
|
+
environment?: string
|
|
246
|
+
/**
|
|
247
|
+
* 仅支付宝小程序生效
|
|
248
|
+
* screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
|
|
249
|
+
* https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
|
|
250
|
+
* 单位: px
|
|
251
|
+
* */
|
|
252
|
+
screen?: {
|
|
253
|
+
/** 屏幕宽度 */
|
|
254
|
+
width: number
|
|
255
|
+
/** 屏幕高度 */
|
|
256
|
+
height: number
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/** 系统主题合法值 */
|
|
260
|
+
interface Theme {
|
|
261
|
+
/** 深色主题 */
|
|
262
|
+
dark
|
|
263
|
+
/** 浅色主题 */
|
|
264
|
+
light
|
|
265
|
+
}
|
|
266
|
+
interface Host {
|
|
267
|
+
/** 宿主 app 对应的 appId */
|
|
268
|
+
appId: string
|
|
269
|
+
}
|
|
270
|
+
/** 设备方向合法值 */
|
|
271
|
+
interface DeviceOrientation {
|
|
272
|
+
/** 竖屏 */
|
|
273
|
+
portrait
|
|
274
|
+
/** 横屏 */
|
|
275
|
+
landscape
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
namespace getSystemInfo {
|
|
280
|
+
interface Option {
|
|
281
|
+
/** 接口调用成功的回调函数 */
|
|
282
|
+
success?: (res: Result) => void
|
|
283
|
+
/** 接口调用失败的回调函数 */
|
|
284
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
285
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
286
|
+
complete?: (res: TaroGeneral.CallbackResult | Result) => void
|
|
287
|
+
}
|
|
288
|
+
interface Result extends TaroGeneral.CallbackResult {
|
|
289
|
+
/** 设备品牌 */
|
|
290
|
+
brand: string
|
|
291
|
+
/** 设备型号 */
|
|
292
|
+
model: string
|
|
293
|
+
/** 设备像素比 */
|
|
294
|
+
pixelRatio: number
|
|
295
|
+
/** 屏幕宽度,单位px */
|
|
296
|
+
screenWidth: number
|
|
297
|
+
/** 屏幕高度,单位px */
|
|
298
|
+
screenHeight: number
|
|
299
|
+
/** 可使用窗口宽度,单位px */
|
|
300
|
+
windowWidth: number
|
|
301
|
+
/** 可使用窗口高度,单位px */
|
|
302
|
+
windowHeight: number
|
|
303
|
+
/** 状态栏的高度,单位px */
|
|
304
|
+
statusBarHeight?: number
|
|
305
|
+
/** 微信设置的语言 */
|
|
306
|
+
language: string
|
|
307
|
+
/** 微信版本号 */
|
|
308
|
+
version?: string
|
|
309
|
+
/** 操作系统及版本 */
|
|
310
|
+
system: string
|
|
311
|
+
/** 客户端平台 */
|
|
312
|
+
platform: string
|
|
313
|
+
/** 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */
|
|
314
|
+
fontSizeSetting?: number
|
|
315
|
+
/** 客户端基础库版本 */
|
|
316
|
+
SDKVersion?: string
|
|
317
|
+
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
318
|
+
benchmarkLevel: number
|
|
319
|
+
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
320
|
+
albumAuthorized?: boolean
|
|
321
|
+
/** 允许微信使用摄像头的开关 */
|
|
322
|
+
cameraAuthorized?: boolean
|
|
323
|
+
/** 允许微信使用定位的开关 */
|
|
324
|
+
locationAuthorized?: boolean
|
|
325
|
+
/** 允许微信使用麦克风的开关 */
|
|
326
|
+
microphoneAuthorized?: boolean
|
|
327
|
+
/** 允许微信通知的开关 */
|
|
328
|
+
notificationAuthorized?: boolean
|
|
329
|
+
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
330
|
+
notificationAlertAuthorized?: boolean
|
|
331
|
+
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
332
|
+
notificationBadgeAuthorized?: boolean
|
|
333
|
+
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
334
|
+
notificationSoundAuthorized?: boolean
|
|
335
|
+
/** 允许微信使用日历的开关 */
|
|
336
|
+
phoneCalendarAuthorized?: boolean
|
|
337
|
+
/** 蓝牙的系统开关 */
|
|
338
|
+
bluetoothEnabled?: boolean
|
|
339
|
+
/** 地理位置的系统开关 */
|
|
340
|
+
locationEnabled?: boolean
|
|
341
|
+
/** Wi-Fi 的系统开关 */
|
|
342
|
+
wifiEnabled?: boolean
|
|
343
|
+
/** 在竖屏正方向下的安全区域 */
|
|
344
|
+
safeArea?: TaroGeneral.SafeAreaResult
|
|
345
|
+
/** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */
|
|
346
|
+
locationReducedAccuracy?: boolean
|
|
347
|
+
/** 系统当前主题,取值为light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) */
|
|
348
|
+
theme?: keyof Theme
|
|
349
|
+
/** 当前小程序运行的宿主环境 */
|
|
350
|
+
host?: Host
|
|
351
|
+
/** 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 */
|
|
352
|
+
enableDebug?: boolean
|
|
353
|
+
/** 设备方向 */
|
|
354
|
+
deviceOrientation?: keyof DeviceOrientation
|
|
355
|
+
/** 小程序当前运行环境 */
|
|
356
|
+
environment?: string
|
|
357
|
+
/**
|
|
358
|
+
* 仅支付宝小程序生效
|
|
359
|
+
* screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
|
|
360
|
+
* https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
|
|
361
|
+
* 单位: px
|
|
362
|
+
* */
|
|
363
|
+
screen?: {
|
|
364
|
+
/** 屏幕宽度 */
|
|
365
|
+
width: number
|
|
366
|
+
/** 屏幕高度 */
|
|
367
|
+
height: number
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/** 系统主题合法值 */
|
|
371
|
+
interface Theme {
|
|
372
|
+
/** 深色主题 */
|
|
373
|
+
dark
|
|
374
|
+
/** 浅色主题 */
|
|
375
|
+
light
|
|
376
|
+
}
|
|
377
|
+
interface Host {
|
|
378
|
+
/** 宿主 app 对应的 appId */
|
|
379
|
+
appId: string
|
|
380
|
+
}
|
|
381
|
+
/** 设备方向合法值 */
|
|
382
|
+
interface DeviceOrientation {
|
|
383
|
+
/** 竖屏 */
|
|
384
|
+
portrait
|
|
385
|
+
/** 横屏 */
|
|
386
|
+
landscape
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
namespace getSkylineInfoSync {
|
|
391
|
+
interface Result {
|
|
392
|
+
/** 当前运行环境是否支持 Skyline 渲染引擎 */
|
|
393
|
+
isSupported: boolean
|
|
394
|
+
/** 当前运行环境 Skyline 渲染引擎 的版本号,形如 0.9.7 */
|
|
395
|
+
version: string
|
|
396
|
+
/** 当前运行环境不支持 Skyline 渲染引擎 的原因,仅在 isSupported 为 false 时出现 */
|
|
397
|
+
reason?: string
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
namespace getSkylineInfo {
|
|
402
|
+
interface Option {
|
|
403
|
+
/** 接口调用成功的回调函数 */
|
|
404
|
+
success?: (res: Result) => void
|
|
405
|
+
/** 接口调用失败的回调函数 */
|
|
406
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
407
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
408
|
+
complete?: (res: TaroGeneral.CallbackResult | Result) => void
|
|
409
|
+
}
|
|
410
|
+
interface Result {
|
|
411
|
+
/** 当前运行环境是否支持 Skyline 渲染引擎 */
|
|
412
|
+
isSupported: boolean
|
|
413
|
+
/** 当前运行环境 Skyline 渲染引擎 的版本号,形如 0.9.7 */
|
|
414
|
+
version: string
|
|
415
|
+
/** 当前运行环境不支持 Skyline 渲染引擎 的原因,仅在 isSupported 为 false 时出现 */
|
|
416
|
+
reason?: string
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
namespace getRendererUserAgent {
|
|
421
|
+
interface Option {
|
|
422
|
+
/** 接口调用成功的回调函数 */
|
|
423
|
+
success?: (res: Result) => void
|
|
424
|
+
/** 接口调用失败的回调函数 */
|
|
425
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
426
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
427
|
+
complete?: (res: TaroGeneral.CallbackResult | Result) => void
|
|
428
|
+
}
|
|
429
|
+
interface Result {
|
|
430
|
+
userAgent: string
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
namespace getDeviceInfo {
|
|
435
|
+
interface Result {
|
|
436
|
+
/** 应用二进制接口类型(仅 Android 支持) */
|
|
437
|
+
abi?: string
|
|
438
|
+
/** 设备二进制接口类型(仅 Android 支持) */
|
|
439
|
+
deviceAbi: string
|
|
440
|
+
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
441
|
+
benchmarkLevel: number
|
|
442
|
+
/** 设备品牌 */
|
|
443
|
+
brand: string
|
|
444
|
+
/** 设备型号 */
|
|
445
|
+
model: string
|
|
446
|
+
/** 操作系统及版本 */
|
|
447
|
+
system: string
|
|
448
|
+
/** 客户端平台 */
|
|
449
|
+
platform: string
|
|
450
|
+
/** 设备 CPU 型号(仅 Android 支持) */
|
|
451
|
+
CPUType: string
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
namespace getAppBaseInfo {
|
|
456
|
+
interface Result {
|
|
457
|
+
/** 客户端基础库版本 */
|
|
458
|
+
SDKVersion?: string
|
|
459
|
+
/** 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 */
|
|
460
|
+
enableDebug?: boolean
|
|
461
|
+
/** 当前小程序运行的宿主环境 */
|
|
462
|
+
host?: Host
|
|
463
|
+
/** 微信设置的语言 */
|
|
464
|
+
language: string
|
|
465
|
+
/** 微信版本号 */
|
|
466
|
+
version?: string
|
|
467
|
+
/** 系统当前主题,取值为light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) */
|
|
468
|
+
theme?: keyof Theme
|
|
469
|
+
}
|
|
470
|
+
/** 系统主题合法值 */
|
|
471
|
+
interface Theme {
|
|
472
|
+
/** 深色主题 */
|
|
473
|
+
dark
|
|
474
|
+
/** 浅色主题 */
|
|
475
|
+
light
|
|
476
|
+
}
|
|
477
|
+
interface Host {
|
|
478
|
+
/** 宿主 app 对应的 appId */
|
|
479
|
+
appId: string
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
namespace getAppAuthorizeSetting {
|
|
484
|
+
interface Result {
|
|
485
|
+
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
486
|
+
albumAuthorized: keyof Authorized
|
|
487
|
+
/** 允许微信使用蓝牙的开关(仅 iOS 有效) */
|
|
488
|
+
bluetoothAuthorized: keyof Authorized
|
|
489
|
+
/** 允许微信使用摄像头的开关 */
|
|
490
|
+
cameraAuthorized: keyof Authorized
|
|
491
|
+
/** 允许微信使用定位的开关 */
|
|
492
|
+
locationAuthorized: keyof Authorized
|
|
493
|
+
/** 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效) */
|
|
494
|
+
locationReducedAccuracy: boolean
|
|
495
|
+
/** 允许微信使用麦克风的开关 */
|
|
496
|
+
microphoneAuthorized: keyof Authorized
|
|
497
|
+
/** 允许微信通知的开关 */
|
|
498
|
+
notificationAuthorized: keyof Authorized
|
|
499
|
+
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
500
|
+
notificationAlertAuthorized: keyof Authorized
|
|
501
|
+
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
502
|
+
notificationBadgeAuthorized: keyof Authorized
|
|
503
|
+
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
504
|
+
notificationSoundAuthorized: keyof Authorized
|
|
505
|
+
/** 允许微信读写日历的开关 */
|
|
506
|
+
phoneCalendarAuthorized: keyof Authorized
|
|
507
|
+
}
|
|
508
|
+
/** 授权合法值 */
|
|
509
|
+
interface Authorized {
|
|
510
|
+
/** 表示已经获得授权,无需再次请求授权 */
|
|
511
|
+
authorized
|
|
512
|
+
/** 表示请求授权被拒绝,无法再次请求授权 (此情况需要引导用户打开[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限) */
|
|
513
|
+
denied
|
|
514
|
+
/** 表示尚未请求授权,会在微信下一次调用系统相应权限时请求 (仅 iOS 会出现。此种情况下引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),不展示开关) */
|
|
515
|
+
'not determined'
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
interface TaroStatic {
|
|
520
|
+
/** 跳转系统蓝牙设置页
|
|
521
|
+
* @supported weapp
|
|
522
|
+
* @example
|
|
523
|
+
* ```tsx
|
|
524
|
+
* Taro.openSystemBluetoothSetting({
|
|
525
|
+
* success (res) {
|
|
526
|
+
* console.log(res)
|
|
527
|
+
* }
|
|
528
|
+
* })
|
|
529
|
+
* ```
|
|
530
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openSystemBluetoothSetting.html
|
|
531
|
+
*/
|
|
532
|
+
openSystemBluetoothSetting(option: openSystemBluetoothSetting.Option): Promise<TaroGeneral.CallbackResult>
|
|
533
|
+
|
|
534
|
+
/** 跳转系统微信授权管理页
|
|
535
|
+
* @supported weapp
|
|
536
|
+
* @example
|
|
537
|
+
* ```tsx
|
|
538
|
+
* Taro.openAppAuthorizeSetting({
|
|
539
|
+
* success (res) {
|
|
540
|
+
* console.log(res)
|
|
541
|
+
* }
|
|
542
|
+
* })
|
|
543
|
+
* ```
|
|
544
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html
|
|
545
|
+
*/
|
|
546
|
+
openAppAuthorizeSetting(option: openAppAuthorizeSetting.Option): Promise<TaroGeneral.CallbackResult>
|
|
547
|
+
|
|
548
|
+
/** 获取窗口信息
|
|
549
|
+
* @supported weapp, harmony_hybrid
|
|
550
|
+
* @h5 不支持 statusBarHeight、safeArea
|
|
551
|
+
* @example
|
|
552
|
+
* ```tsx
|
|
553
|
+
* const windowInfo = Taro.getWindowInfo()
|
|
554
|
+
*
|
|
555
|
+
* console.log(windowInfo.pixelRatio)
|
|
556
|
+
* console.log(windowInfo.screenWidth)
|
|
557
|
+
* console.log(windowInfo.screenHeight)
|
|
558
|
+
* console.log(windowInfo.windowWidth)
|
|
559
|
+
* console.log(windowInfo.windowHeight)
|
|
560
|
+
* console.log(windowInfo.statusBarHeight)
|
|
561
|
+
* console.log(windowInfo.safeArea)
|
|
562
|
+
* console.log(windowInfo.screenTop)
|
|
563
|
+
* ```
|
|
564
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getWindowInfo.html
|
|
565
|
+
*/
|
|
566
|
+
getWindowInfo(): getWindowInfo.Result
|
|
567
|
+
|
|
568
|
+
/** 获取设备设置
|
|
569
|
+
* @supported weapp, h5, harmony_hybrid
|
|
570
|
+
* @h5 不支持 bluetoothEnabled、locationEnabled、wifiEnabled
|
|
571
|
+
* @example
|
|
572
|
+
* ```tsx
|
|
573
|
+
* const systemSetting = Taro.getSystemSetting()
|
|
574
|
+
*
|
|
575
|
+
* console.log(systemSetting.bluetoothEnabled)
|
|
576
|
+
* console.log(systemSetting.deviceOrientation)
|
|
577
|
+
* console.log(systemSetting.locationEnabled)
|
|
578
|
+
* console.log(systemSetting.wifiEnabled)
|
|
579
|
+
* ```
|
|
580
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemSetting.html
|
|
581
|
+
*/
|
|
582
|
+
getSystemSetting(): getSystemSetting.Result
|
|
583
|
+
|
|
584
|
+
/** [Taro.getSystemInfo](./getSystemInfo) 的同步版本
|
|
585
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
586
|
+
* @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
|
|
587
|
+
* @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
|
|
588
|
+
* @example
|
|
589
|
+
* ```tsx
|
|
590
|
+
* try {
|
|
591
|
+
* const res = Taro.getSystemInfoSync()
|
|
592
|
+
* console.log(res.model)
|
|
593
|
+
* console.log(res.pixelRatio)
|
|
594
|
+
* console.log(res.windowWidth)
|
|
595
|
+
* console.log(res.windowHeight)
|
|
596
|
+
* console.log(res.language)
|
|
597
|
+
* console.log(res.version)
|
|
598
|
+
* console.log(res.platform)
|
|
599
|
+
* } catch (e) {
|
|
600
|
+
* // Do something when catch error
|
|
601
|
+
* }
|
|
602
|
+
* ```
|
|
603
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfoSync.html
|
|
604
|
+
*/
|
|
605
|
+
getSystemInfoSync(): getSystemInfoSync.Result
|
|
606
|
+
|
|
607
|
+
/** 异步获取系统信息。需要一定的微信客户端版本支持,在不支持的客户端上,会使用同步实现来返回。
|
|
608
|
+
* @supported weapp, h5
|
|
609
|
+
* @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
|
|
610
|
+
* @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
|
|
611
|
+
* @example
|
|
612
|
+
* ```tsx
|
|
613
|
+
* Taro.getSystemInfoAsync({
|
|
614
|
+
* success (res) {
|
|
615
|
+
* console.log(res.model)
|
|
616
|
+
* console.log(res.pixelRatio)
|
|
617
|
+
* console.log(res.windowWidth)
|
|
618
|
+
* console.log(res.windowHeight)
|
|
619
|
+
* console.log(res.language)
|
|
620
|
+
* console.log(res.version)
|
|
621
|
+
* console.log(res.platform)
|
|
622
|
+
* }
|
|
623
|
+
* })
|
|
624
|
+
* ```
|
|
625
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoAsync.html
|
|
626
|
+
*/
|
|
627
|
+
getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise<getSystemInfo.Result>
|
|
628
|
+
|
|
629
|
+
/** 获取系统信息,支持 `Promise` 化使用。
|
|
630
|
+
* @supported weapp, h5, rn, tt, harmony, harmony_hybrid
|
|
631
|
+
* @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
|
|
632
|
+
* @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
|
|
633
|
+
* @example
|
|
634
|
+
* ```tsx
|
|
635
|
+
* Taro.getSystemInfo({
|
|
636
|
+
* success: res => console.log(res)
|
|
637
|
+
* })
|
|
638
|
+
* .then(res => console.log(res))
|
|
639
|
+
* ```
|
|
640
|
+
* @example
|
|
641
|
+
* ```tsx
|
|
642
|
+
* Taro.getSystemInfo({
|
|
643
|
+
* success: function (res) {
|
|
644
|
+
* console.log(res.model)
|
|
645
|
+
* console.log(res.pixelRatio)
|
|
646
|
+
* console.log(res.windowWidth)
|
|
647
|
+
* console.log(res.windowHeight)
|
|
648
|
+
* console.log(res.language)
|
|
649
|
+
* console.log(res.version)
|
|
650
|
+
* console.log(res.platform)
|
|
651
|
+
* }
|
|
652
|
+
* })
|
|
653
|
+
* ```
|
|
654
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfo.html
|
|
655
|
+
*/
|
|
656
|
+
getSystemInfo(res?: getSystemInfo.Option): Promise<getSystemInfo.Result>
|
|
657
|
+
|
|
658
|
+
/** 获取当前运行环境对于 Skyline 渲染引擎 的支持情况
|
|
659
|
+
* 基础库 2.26.2 开始支持
|
|
660
|
+
* @supported weapp
|
|
661
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSkylineInfoSync.html
|
|
662
|
+
*/
|
|
663
|
+
getSkylineInfoSync(): getSkylineInfoSync.Result
|
|
664
|
+
|
|
665
|
+
/** 获取当前运行环境对于 Skyline 渲染引擎 的支持情况
|
|
666
|
+
* 基础库 2.26.2 开始支持
|
|
667
|
+
* @supported weapp
|
|
668
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSkylineInfo.html
|
|
669
|
+
*/
|
|
670
|
+
getSkylineInfo(option?: getSkylineInfo.Option): Promise<getSkylineInfo.Result>
|
|
671
|
+
|
|
672
|
+
/** 获取 Webview 小程序的 UserAgent
|
|
673
|
+
* 基础库 2.26.3 开始支持
|
|
674
|
+
* @supported weapp
|
|
675
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getRendererUserAgent.html
|
|
676
|
+
*/
|
|
677
|
+
getRendererUserAgent(option?: getRendererUserAgent.Option): Promise<getRendererUserAgent.Result>
|
|
678
|
+
|
|
679
|
+
/** 获取设备基础信息
|
|
680
|
+
* @supported weapp, h5
|
|
681
|
+
* @h5 不支持 abi、benchmarkLevel
|
|
682
|
+
* @example
|
|
683
|
+
* ```tsx
|
|
684
|
+
* const deviceInfo = Taro.getDeviceInfo()
|
|
685
|
+
*
|
|
686
|
+
* console.log(deviceInfo.abi)
|
|
687
|
+
* console.log(deviceInfo.benchmarkLevel)
|
|
688
|
+
* console.log(deviceInfo.brand)
|
|
689
|
+
* console.log(deviceInfo.model)
|
|
690
|
+
* console.log(deviceInfo.platform)
|
|
691
|
+
* console.log(deviceInfo.system)
|
|
692
|
+
* ```
|
|
693
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html
|
|
694
|
+
*/
|
|
695
|
+
getDeviceInfo(): getDeviceInfo.Result
|
|
696
|
+
|
|
697
|
+
/** 获取微信APP基础信息
|
|
698
|
+
* @supported weapp, h5, harmony_hybrid
|
|
699
|
+
* @h5 不支持 SDKVersion、host、version
|
|
700
|
+
* @example
|
|
701
|
+
* ```tsx
|
|
702
|
+
* const appBaseInfo = Taro.getAppBaseInfo()
|
|
703
|
+
*
|
|
704
|
+
* console.log(appBaseInfo.SDKVersion)
|
|
705
|
+
* console.log(appBaseInfo.enableDebug)
|
|
706
|
+
* console.log(appBaseInfo.host)
|
|
707
|
+
* console.log(appBaseInfo.language)
|
|
708
|
+
* console.log(appBaseInfo.version)
|
|
709
|
+
* console.log(appBaseInfo.theme)
|
|
710
|
+
* ```
|
|
711
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppBaseInfo.html
|
|
712
|
+
*/
|
|
713
|
+
getAppBaseInfo(): getAppBaseInfo.Result
|
|
714
|
+
|
|
715
|
+
/** 获取微信APP授权设置
|
|
716
|
+
*
|
|
717
|
+
* - 'authorized' 表示已经获得授权,无需再次请求授权;
|
|
718
|
+
* - 'denied' 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限)
|
|
719
|
+
* - 'non determined' 表示尚未请求授权,会在微信下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
|
|
720
|
+
* @supported weapp, h5, harmony_hybrid
|
|
721
|
+
* @h5 暂未支持设置权限
|
|
722
|
+
* @example
|
|
723
|
+
* ```tsx
|
|
724
|
+
* const appAuthorizeSetting = Taro.getAppAuthorizeSetting()
|
|
725
|
+
*
|
|
726
|
+
* console.log(appAuthorizeSetting.albumAuthorized)
|
|
727
|
+
* console.log(appAuthorizeSetting.bluetoothAuthorized)
|
|
728
|
+
* console.log(appAuthorizeSetting.cameraAuthorized)
|
|
729
|
+
* console.log(appAuthorizeSetting.locationAuthorized)
|
|
730
|
+
* console.log(appAuthorizeSetting.locationReducedAccuracy)
|
|
731
|
+
* console.log(appAuthorizeSetting.microphoneAuthorized)
|
|
732
|
+
* console.log(appAuthorizeSetting.notificationAlertAuthorized)
|
|
733
|
+
* console.log(appAuthorizeSetting.notificationAuthorized)
|
|
734
|
+
* console.log(appAuthorizeSetting.notificationBadgeAuthorized)
|
|
735
|
+
* console.log(appAuthorizeSetting.notificationSoundAuthorized)
|
|
736
|
+
* console.log(appAuthorizeSetting.phoneCalendarAuthorized)
|
|
737
|
+
* ```
|
|
738
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppAuthorizeSetting.html
|
|
739
|
+
*/
|
|
740
|
+
getAppAuthorizeSetting(): getAppAuthorizeSetting.Result
|
|
741
|
+
}
|
|
742
|
+
}
|