@doubao-apps/create 0.0.25 → 0.0.27
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/dist/36.js +4 -4
- package/dist/template-empty/.ai/examples/common-patterns.md +53 -43
- package/dist/template-empty/.ai/examples/component-basics.md +0 -17
- package/dist/template-empty/.ai/guides/component-development.md +96 -214
- package/dist/template-empty/.ai/guides/system-prompt.md +14 -14
- package/dist/template-empty/.ai/reference/framework-api-quick-ref.md +46 -85
- package/dist/template-empty/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
- package/dist/template-empty/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
- package/dist/template-empty/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
- package/dist/template-empty/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
- package/dist/template-empty/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
- package/dist/template-empty/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
- package/dist/template-empty/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
- package/dist/template-empty/.ai/reference/open-api/08-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +546 -0
- package/dist/template-empty/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
- package/dist/template-empty/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
- package/dist/template-empty/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
- package/dist/template-empty/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
- package/dist/template-empty/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
- package/dist/template-empty/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
- package/dist/template-empty/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
- package/dist/template-empty/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
- package/dist/template-empty/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
- package/dist/template-empty/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
- package/dist/template-empty/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
- package/dist/template-empty/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
- package/dist/template-empty/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
- package/dist/template-empty/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
- package/dist/template-empty/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
- package/dist/template-empty/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
- package/dist/template-empty/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
- package/dist/template-empty/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
- package/dist/template-empty/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
- package/dist/template-empty/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
- package/dist/template-empty/.ai/reference/open-api/README.md +36 -0
- package/dist/template-empty/.ai/reference/open-api.md +1758 -266
- package/dist/template-empty/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-empty/AGENTS.md +56 -33
- package/dist/template-empty/README.md +57 -10
- package/dist/template-empty/package.json +2 -2
- package/dist/template-empty/src/app.config.ts +6 -0
- package/dist/template-empty/src/app.ts +0 -6
- package/dist/template-empty/tsconfig.json +2 -0
- package/dist/template-starter/.ai/examples/common-patterns.md +53 -43
- package/dist/template-starter/.ai/examples/component-basics.md +0 -17
- package/dist/template-starter/.ai/guides/component-development.md +96 -214
- package/dist/template-starter/.ai/guides/system-prompt.md +14 -14
- package/dist/template-starter/.ai/reference/framework-api-quick-ref.md +46 -85
- package/dist/template-starter/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
- package/dist/template-starter/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
- package/dist/template-starter/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
- package/dist/template-starter/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
- package/dist/template-starter/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
- package/dist/template-starter/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
- package/dist/template-starter/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
- package/dist/template-starter/.ai/reference/open-api/08-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +546 -0
- package/dist/template-starter/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
- package/dist/template-starter/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
- package/dist/template-starter/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
- package/dist/template-starter/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
- package/dist/template-starter/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
- package/dist/template-starter/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
- package/dist/template-starter/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
- package/dist/template-starter/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
- package/dist/template-starter/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
- package/dist/template-starter/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
- package/dist/template-starter/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
- package/dist/template-starter/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
- package/dist/template-starter/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
- package/dist/template-starter/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
- package/dist/template-starter/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
- package/dist/template-starter/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
- package/dist/template-starter/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
- package/dist/template-starter/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
- package/dist/template-starter/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
- package/dist/template-starter/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
- package/dist/template-starter/.ai/reference/open-api/README.md +36 -0
- package/dist/template-starter/.ai/reference/open-api.md +1758 -266
- package/dist/template-starter/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-starter/AGENTS.md +56 -33
- package/dist/template-starter/README.md +6 -1
- package/dist/template-starter/package.json +2 -2
- package/dist/template-starter/src/app.config.ts +35 -0
- package/dist/template-starter/src/app.ts +0 -6
- package/dist/template-starter/src/pages/applet/index.tsx +0 -5
- package/dist/template-starter/src/pages/home/index.tsx +0 -5
- package/dist/template-starter/src/pages/lynx/index.tsx +0 -4
- package/dist/template-starter/src/pages/react-lynx/index.tsx +0 -5
- package/dist/template-starter/src/widgets/weather-card/index.tsx +0 -4
- package/dist/template-starter/tsconfig.json +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Open API: 设备 / Wi-Fi
|
|
2
|
+
|
|
3
|
+
Wi-Fi 模块能力;通常先 startWifi,再获取列表或连接。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startWifi](#startwifi) | 初始化 Wi-Fi 模块。<br><br>Wi-Fi 流程入口。 |
|
|
12
|
+
| [stopWifi](#stopwifi) | 关闭 Wi-Fi 模块。 |
|
|
13
|
+
| [setWifiList](#setwifilist) | 设置 Wi-Fi 预设列表。<br><br>用于预设 Wi-Fi 列表。 |
|
|
14
|
+
| [connectWifi](#connectwifi) | 连接指定 Wi-Fi。<br><br>通常先调用 startWifi。 |
|
|
15
|
+
| [getConnectedWifi](#getconnectedwifi) | 获取当前已连接 Wi-Fi 信息。 |
|
|
16
|
+
| [getWifiList](#getwifilist) | 获取 Wi-Fi 列表。<br><br>通常先调用 startWifi。 |
|
|
17
|
+
|
|
18
|
+
## API 详情
|
|
19
|
+
|
|
20
|
+
<a id="startwifi"></a>
|
|
21
|
+
### startWifi()
|
|
22
|
+
|
|
23
|
+
> **startWifi**(`params`?): `Promise`\<`object`\>
|
|
24
|
+
|
|
25
|
+
初始化 Wi-Fi 模块。
|
|
26
|
+
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
• **params?**
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<`object`\>
|
|
34
|
+
|
|
35
|
+
#### Remarks
|
|
36
|
+
|
|
37
|
+
Wi-Fi 流程入口。
|
|
38
|
+
|
|
39
|
+
<a id="stopwifi"></a>
|
|
40
|
+
### stopWifi()
|
|
41
|
+
|
|
42
|
+
> **stopWifi**(`params`?): `Promise`\<`object`\>
|
|
43
|
+
|
|
44
|
+
关闭 Wi-Fi 模块。
|
|
45
|
+
|
|
46
|
+
#### Parameters
|
|
47
|
+
|
|
48
|
+
• **params?**
|
|
49
|
+
|
|
50
|
+
#### Returns
|
|
51
|
+
|
|
52
|
+
`Promise`\<`object`\>
|
|
53
|
+
|
|
54
|
+
<a id="setwifilist"></a>
|
|
55
|
+
### setWifiList()
|
|
56
|
+
|
|
57
|
+
> **setWifiList**(`params`): `Promise`\<`object`\>
|
|
58
|
+
|
|
59
|
+
设置 Wi-Fi 预设列表。
|
|
60
|
+
|
|
61
|
+
#### Parameters
|
|
62
|
+
|
|
63
|
+
• **params**: [`SetWifiListParams`](#setwifilistparams)
|
|
64
|
+
|
|
65
|
+
#### Returns
|
|
66
|
+
|
|
67
|
+
`Promise`\<`object`\>
|
|
68
|
+
|
|
69
|
+
#### Remarks
|
|
70
|
+
|
|
71
|
+
用于预设 Wi-Fi 列表。
|
|
72
|
+
|
|
73
|
+
<a id="connectwifi"></a>
|
|
74
|
+
### connectWifi()
|
|
75
|
+
|
|
76
|
+
> **connectWifi**(`params`): `Promise`\<`object`\>
|
|
77
|
+
|
|
78
|
+
连接指定 Wi-Fi。
|
|
79
|
+
|
|
80
|
+
#### Parameters
|
|
81
|
+
|
|
82
|
+
• **params**: [`ConnectWifiParams`](#connectwifiparams)
|
|
83
|
+
|
|
84
|
+
#### Returns
|
|
85
|
+
|
|
86
|
+
`Promise`\<`object`\>
|
|
87
|
+
|
|
88
|
+
#### Remarks
|
|
89
|
+
|
|
90
|
+
通常先调用 startWifi。
|
|
91
|
+
|
|
92
|
+
<a id="getconnectedwifi"></a>
|
|
93
|
+
### getConnectedWifi()
|
|
94
|
+
|
|
95
|
+
> **getConnectedWifi**(`params`?): `Promise`\<[`GetConnectedWifiResult`](#getconnectedwifiresult)\>
|
|
96
|
+
|
|
97
|
+
获取当前已连接 Wi-Fi 信息。
|
|
98
|
+
|
|
99
|
+
#### Parameters
|
|
100
|
+
|
|
101
|
+
• **params?**: [`GetConnectedWifiParams`](#getconnectedwifiparams)
|
|
102
|
+
|
|
103
|
+
#### Returns
|
|
104
|
+
|
|
105
|
+
`Promise`\<[`GetConnectedWifiResult`](#getconnectedwifiresult)\>
|
|
106
|
+
|
|
107
|
+
<a id="getwifilist"></a>
|
|
108
|
+
### getWifiList()
|
|
109
|
+
|
|
110
|
+
> **getWifiList**(`params`?): `Promise`\<[`GetWifiListResult`](#getwifilistresult)\>
|
|
111
|
+
|
|
112
|
+
获取 Wi-Fi 列表。
|
|
113
|
+
|
|
114
|
+
#### Parameters
|
|
115
|
+
|
|
116
|
+
• **params?**
|
|
117
|
+
|
|
118
|
+
#### Returns
|
|
119
|
+
|
|
120
|
+
`Promise`\<[`GetWifiListResult`](#getwifilistresult)\>
|
|
121
|
+
|
|
122
|
+
#### Remarks
|
|
123
|
+
|
|
124
|
+
通常先调用 startWifi。
|
|
125
|
+
|
|
126
|
+
## 相关类型
|
|
127
|
+
|
|
128
|
+
<a id="setwifilistparams"></a>
|
|
129
|
+
### SetWifiListParams
|
|
130
|
+
|
|
131
|
+
设置 Wi-Fi 预设列表的请求参数。
|
|
132
|
+
|
|
133
|
+
#### Properties
|
|
134
|
+
|
|
135
|
+
##### wifiList
|
|
136
|
+
|
|
137
|
+
> **wifiList**: [`WifiListItem`](#wifilistitem)[]
|
|
138
|
+
|
|
139
|
+
预设的 Wi-Fi 列表。
|
|
140
|
+
|
|
141
|
+
<a id="wifilistitem"></a>
|
|
142
|
+
### WifiListItem
|
|
143
|
+
|
|
144
|
+
预设 Wi-Fi 条目。
|
|
145
|
+
|
|
146
|
+
#### Properties
|
|
147
|
+
|
|
148
|
+
##### bssid?
|
|
149
|
+
|
|
150
|
+
> `optional` **bssid**: `string`
|
|
151
|
+
|
|
152
|
+
Wi-Fi BSSID。
|
|
153
|
+
|
|
154
|
+
##### password?
|
|
155
|
+
|
|
156
|
+
> `optional` **password**: `string`
|
|
157
|
+
|
|
158
|
+
Wi-Fi 密码。
|
|
159
|
+
|
|
160
|
+
##### ssid?
|
|
161
|
+
|
|
162
|
+
> `optional` **ssid**: `string`
|
|
163
|
+
|
|
164
|
+
Wi-Fi SSID。
|
|
165
|
+
|
|
166
|
+
<a id="connectwifiparams"></a>
|
|
167
|
+
### ConnectWifiParams
|
|
168
|
+
|
|
169
|
+
连接 Wi-Fi 的请求参数。
|
|
170
|
+
|
|
171
|
+
#### Properties
|
|
172
|
+
|
|
173
|
+
##### bssid?
|
|
174
|
+
|
|
175
|
+
> `optional` **bssid**: `string`
|
|
176
|
+
|
|
177
|
+
Wi-Fi BSSID。
|
|
178
|
+
|
|
179
|
+
##### manual?
|
|
180
|
+
|
|
181
|
+
> `optional` **manual**: `boolean`
|
|
182
|
+
|
|
183
|
+
是否跳转到系统设置页连接。
|
|
184
|
+
|
|
185
|
+
##### partialInfo?
|
|
186
|
+
|
|
187
|
+
> `optional` **partialInfo**: `boolean`
|
|
188
|
+
|
|
189
|
+
是否仅返回部分 Wi-Fi 信息。
|
|
190
|
+
|
|
191
|
+
##### password
|
|
192
|
+
|
|
193
|
+
> **password**: `string`
|
|
194
|
+
|
|
195
|
+
Wi-Fi 密码。
|
|
196
|
+
|
|
197
|
+
##### ssid
|
|
198
|
+
|
|
199
|
+
> **ssid**: `string`
|
|
200
|
+
|
|
201
|
+
Wi-Fi SSID。
|
|
202
|
+
|
|
203
|
+
<a id="getconnectedwifiparams"></a>
|
|
204
|
+
### GetConnectedWifiParams
|
|
205
|
+
|
|
206
|
+
获取当前已连接 Wi-Fi 的请求参数。
|
|
207
|
+
|
|
208
|
+
#### Properties
|
|
209
|
+
|
|
210
|
+
##### partialInfo?
|
|
211
|
+
|
|
212
|
+
> `optional` **partialInfo**: `boolean`
|
|
213
|
+
|
|
214
|
+
是否只返回部分 Wi-Fi 信息。
|
|
215
|
+
|
|
216
|
+
<a id="getconnectedwifiresult"></a>
|
|
217
|
+
### GetConnectedWifiResult
|
|
218
|
+
|
|
219
|
+
获取当前已连接 Wi-Fi 的返回结果。
|
|
220
|
+
|
|
221
|
+
#### Properties
|
|
222
|
+
|
|
223
|
+
##### wifi
|
|
224
|
+
|
|
225
|
+
> **wifi**: [`WifiInfo`](#wifiinfo)
|
|
226
|
+
|
|
227
|
+
当前连接的 Wi-Fi 信息。
|
|
228
|
+
|
|
229
|
+
<a id="wifiinfo"></a>
|
|
230
|
+
### WifiInfo
|
|
231
|
+
|
|
232
|
+
Wi-Fi 信息。
|
|
233
|
+
|
|
234
|
+
#### Properties
|
|
235
|
+
|
|
236
|
+
##### bssid?
|
|
237
|
+
|
|
238
|
+
> `optional` **bssid**: `string`
|
|
239
|
+
|
|
240
|
+
Wi-Fi BSSID。
|
|
241
|
+
|
|
242
|
+
##### frequency?
|
|
243
|
+
|
|
244
|
+
> `optional` **frequency**: `number`
|
|
245
|
+
|
|
246
|
+
频段,单位 MHz。
|
|
247
|
+
|
|
248
|
+
##### secure?
|
|
249
|
+
|
|
250
|
+
> `optional` **secure**: `boolean`
|
|
251
|
+
|
|
252
|
+
Wi-Fi 是否安全。
|
|
253
|
+
|
|
254
|
+
##### signalStrength?
|
|
255
|
+
|
|
256
|
+
> `optional` **signalStrength**: `number`
|
|
257
|
+
|
|
258
|
+
信号强度。
|
|
259
|
+
|
|
260
|
+
##### ssid
|
|
261
|
+
|
|
262
|
+
> **ssid**: `string`
|
|
263
|
+
|
|
264
|
+
Wi-Fi SSID。
|
|
265
|
+
|
|
266
|
+
<a id="getwifilistresult"></a>
|
|
267
|
+
### GetWifiListResult
|
|
268
|
+
|
|
269
|
+
获取 Wi-Fi 列表的返回结果。
|
|
270
|
+
|
|
271
|
+
#### Properties
|
|
272
|
+
|
|
273
|
+
##### wifiList
|
|
274
|
+
|
|
275
|
+
> **wifiList**: [`WifiInfo`](#wifiinfo)[]
|
|
276
|
+
|
|
277
|
+
当前获取到的 Wi-Fi 列表。
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Open API: 设备 / 加速度计
|
|
2
|
+
|
|
3
|
+
加速度计监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startAccelerometer](#startaccelerometer) | 开始监听加速度。<br><br>需配对调用 stopAccelerometer。 |
|
|
12
|
+
| [stopAccelerometer](#stopaccelerometer) | 停止监听加速度。 |
|
|
13
|
+
| [onAccelerometerChange](#onaccelerometerchange) | 监听加速度数据变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startaccelerometer"></a>
|
|
18
|
+
### startAccelerometer()
|
|
19
|
+
|
|
20
|
+
> **startAccelerometer**(`params`?): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始监听加速度。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params?**: [`StartAccelerometerParams`](#startaccelerometerparams)
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopAccelerometer。
|
|
35
|
+
|
|
36
|
+
<a id="stopaccelerometer"></a>
|
|
37
|
+
### stopAccelerometer()
|
|
38
|
+
|
|
39
|
+
> **stopAccelerometer**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止监听加速度。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="onaccelerometerchange"></a>
|
|
52
|
+
### onAccelerometerChange()
|
|
53
|
+
|
|
54
|
+
> **onAccelerometerChange**(`handler`): () => `void`
|
|
55
|
+
|
|
56
|
+
监听加速度数据变化事件。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **handler**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Function`
|
|
65
|
+
|
|
66
|
+
返回取消当前监听函数的函数。
|
|
67
|
+
|
|
68
|
+
##### Returns
|
|
69
|
+
|
|
70
|
+
`void`
|
|
71
|
+
|
|
72
|
+
#### Example
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { onAccelerometerChange } from '@doubao-apps/framework/api';
|
|
76
|
+
|
|
77
|
+
const off = onAccelerometerChange(({ x, y, z, timestamp }) => {
|
|
78
|
+
console.log(x, y, z, timestamp);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
off();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 相关类型
|
|
85
|
+
|
|
86
|
+
<a id="startaccelerometerparams"></a>
|
|
87
|
+
### StartAccelerometerParams
|
|
88
|
+
|
|
89
|
+
开始监听加速度的请求参数。
|
|
90
|
+
|
|
91
|
+
#### Properties
|
|
92
|
+
|
|
93
|
+
##### interval?
|
|
94
|
+
|
|
95
|
+
> `optional` **interval**: [`SensorInterval`](#sensorinterval)
|
|
96
|
+
|
|
97
|
+
监听频率。
|
|
98
|
+
|
|
99
|
+
<a id="sensorinterval"></a>
|
|
100
|
+
### SensorInterval
|
|
101
|
+
|
|
102
|
+
> **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
|
|
103
|
+
|
|
104
|
+
传感器监听频率。
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Open API: 设备 / iBeacon
|
|
2
|
+
|
|
3
|
+
iBeacon 搜索和结果读取能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startBeaconDiscovery](#startbeacondiscovery) | 开始搜索附近的 iBeacon。<br><br>需配对调用 stopBeaconDiscovery。 |
|
|
12
|
+
| [stopBeaconDiscovery](#stopbeacondiscovery) | 停止搜索附近的 iBeacon。 |
|
|
13
|
+
| [getBeacons](#getbeacons) | 获取已搜索到的 iBeacon 列表。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startbeacondiscovery"></a>
|
|
18
|
+
### startBeaconDiscovery()
|
|
19
|
+
|
|
20
|
+
> **startBeaconDiscovery**(`params`): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始搜索附近的 iBeacon。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params**: [`StartBeaconDiscoveryParams`](#startbeacondiscoveryparams)
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopBeaconDiscovery。
|
|
35
|
+
|
|
36
|
+
<a id="stopbeacondiscovery"></a>
|
|
37
|
+
### stopBeaconDiscovery()
|
|
38
|
+
|
|
39
|
+
> **stopBeaconDiscovery**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止搜索附近的 iBeacon。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="getbeacons"></a>
|
|
52
|
+
### getBeacons()
|
|
53
|
+
|
|
54
|
+
> **getBeacons**(`params`?): `Promise`\<[`GetBeaconsResult`](#getbeaconsresult)\>
|
|
55
|
+
|
|
56
|
+
获取已搜索到的 iBeacon 列表。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **params?**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Promise`\<[`GetBeaconsResult`](#getbeaconsresult)\>
|
|
65
|
+
|
|
66
|
+
## 相关类型
|
|
67
|
+
|
|
68
|
+
<a id="startbeacondiscoveryparams"></a>
|
|
69
|
+
### StartBeaconDiscoveryParams
|
|
70
|
+
|
|
71
|
+
开始搜索 iBeacon 的请求参数。
|
|
72
|
+
|
|
73
|
+
#### Properties
|
|
74
|
+
|
|
75
|
+
##### ignoreBluetoothAvailable?
|
|
76
|
+
|
|
77
|
+
> `optional` **ignoreBluetoothAvailable**: `boolean`
|
|
78
|
+
|
|
79
|
+
iOS 下是否忽略蓝牙可用性校验。
|
|
80
|
+
|
|
81
|
+
##### uuids
|
|
82
|
+
|
|
83
|
+
> **uuids**: `string`[]
|
|
84
|
+
|
|
85
|
+
要搜索的 iBeacon UUID 列表。
|
|
86
|
+
|
|
87
|
+
<a id="getbeaconsresult"></a>
|
|
88
|
+
### GetBeaconsResult
|
|
89
|
+
|
|
90
|
+
获取 iBeacon 列表的返回结果。
|
|
91
|
+
|
|
92
|
+
#### Properties
|
|
93
|
+
|
|
94
|
+
##### beacons
|
|
95
|
+
|
|
96
|
+
> **beacons**: [`BeaconInfo`](#beaconinfo)[]
|
|
97
|
+
|
|
98
|
+
当前搜到的 iBeacon 列表。
|
|
99
|
+
|
|
100
|
+
<a id="beaconinfo"></a>
|
|
101
|
+
### BeaconInfo
|
|
102
|
+
|
|
103
|
+
iBeacon 设备信息。
|
|
104
|
+
|
|
105
|
+
#### Properties
|
|
106
|
+
|
|
107
|
+
##### accuracy
|
|
108
|
+
|
|
109
|
+
> **accuracy**: `number`
|
|
110
|
+
|
|
111
|
+
距离,单位米。
|
|
112
|
+
|
|
113
|
+
##### major
|
|
114
|
+
|
|
115
|
+
> **major**: `string`
|
|
116
|
+
|
|
117
|
+
主 ID。
|
|
118
|
+
|
|
119
|
+
##### minor
|
|
120
|
+
|
|
121
|
+
> **minor**: `string`
|
|
122
|
+
|
|
123
|
+
次 ID。
|
|
124
|
+
|
|
125
|
+
##### proximity
|
|
126
|
+
|
|
127
|
+
> **proximity**: [`BeaconProximity`](#beaconproximity)
|
|
128
|
+
|
|
129
|
+
距离等级。
|
|
130
|
+
|
|
131
|
+
##### rssi
|
|
132
|
+
|
|
133
|
+
> **rssi**: `number`
|
|
134
|
+
|
|
135
|
+
RSSI 信号强度,单位 dBm。
|
|
136
|
+
|
|
137
|
+
##### uuid
|
|
138
|
+
|
|
139
|
+
> **uuid**: `string`
|
|
140
|
+
|
|
141
|
+
Beacon UUID。
|
|
142
|
+
|
|
143
|
+
<a id="beaconproximity"></a>
|
|
144
|
+
### BeaconProximity
|
|
145
|
+
|
|
146
|
+
> **BeaconProximity**: `0` \| `1` \| `2` \| `3`
|
|
147
|
+
|
|
148
|
+
iBeacon 距离等级。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Open API: 设备 / 罗盘
|
|
2
|
+
|
|
3
|
+
罗盘监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startCompass](#startcompass) | 开始监听罗盘。<br><br>需配对调用 stopCompass。 |
|
|
12
|
+
| [stopCompass](#stopcompass) | 停止监听罗盘。 |
|
|
13
|
+
| [onCompassChange](#oncompasschange) | 监听罗盘数据变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startcompass"></a>
|
|
18
|
+
### startCompass()
|
|
19
|
+
|
|
20
|
+
> **startCompass**(`params`?): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始监听罗盘。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params?**
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopCompass。
|
|
35
|
+
|
|
36
|
+
<a id="stopcompass"></a>
|
|
37
|
+
### stopCompass()
|
|
38
|
+
|
|
39
|
+
> **stopCompass**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止监听罗盘。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="oncompasschange"></a>
|
|
52
|
+
### onCompassChange()
|
|
53
|
+
|
|
54
|
+
> **onCompassChange**(`handler`): () => `void`
|
|
55
|
+
|
|
56
|
+
监听罗盘数据变化事件。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **handler**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Function`
|
|
65
|
+
|
|
66
|
+
返回取消当前监听函数的函数。
|
|
67
|
+
|
|
68
|
+
##### Returns
|
|
69
|
+
|
|
70
|
+
`void`
|
|
71
|
+
|
|
72
|
+
#### Example
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { onCompassChange } from '@doubao-apps/framework/api';
|
|
76
|
+
|
|
77
|
+
const off = onCompassChange(({ direction }) => {
|
|
78
|
+
console.log(direction);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
off();
|
|
82
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Open API: 设备 / 设备方向
|
|
2
|
+
|
|
3
|
+
设备方向监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startDeviceMotionListening](#startdevicemotionlistening) | 开始监听设备方向变化。<br><br>需配对调用 stopDeviceMotionListening。 |
|
|
12
|
+
| [stopDeviceMotionListening](#stopdevicemotionlistening) | 停止监听设备方向变化。 |
|
|
13
|
+
|
|
14
|
+
## API 详情
|
|
15
|
+
|
|
16
|
+
<a id="startdevicemotionlistening"></a>
|
|
17
|
+
### startDeviceMotionListening()
|
|
18
|
+
|
|
19
|
+
> **startDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
20
|
+
|
|
21
|
+
开始监听设备方向变化。
|
|
22
|
+
|
|
23
|
+
#### Parameters
|
|
24
|
+
|
|
25
|
+
• **params?**: [`StartDeviceMotionListeningParams`](#startdevicemotionlisteningparams)
|
|
26
|
+
|
|
27
|
+
#### Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`object`\>
|
|
30
|
+
|
|
31
|
+
#### Remarks
|
|
32
|
+
|
|
33
|
+
需配对调用 stopDeviceMotionListening。
|
|
34
|
+
|
|
35
|
+
<a id="stopdevicemotionlistening"></a>
|
|
36
|
+
### stopDeviceMotionListening()
|
|
37
|
+
|
|
38
|
+
> **stopDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
39
|
+
|
|
40
|
+
停止监听设备方向变化。
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
• **params?**
|
|
45
|
+
|
|
46
|
+
#### Returns
|
|
47
|
+
|
|
48
|
+
`Promise`\<`object`\>
|
|
49
|
+
|
|
50
|
+
## 相关类型
|
|
51
|
+
|
|
52
|
+
<a id="startdevicemotionlisteningparams"></a>
|
|
53
|
+
### StartDeviceMotionListeningParams
|
|
54
|
+
|
|
55
|
+
开始监听设备方向变化的请求参数。
|
|
56
|
+
|
|
57
|
+
#### Properties
|
|
58
|
+
|
|
59
|
+
##### interval?
|
|
60
|
+
|
|
61
|
+
> `optional` **interval**: [`SensorInterval`](#sensorinterval)
|
|
62
|
+
|
|
63
|
+
监听频率。
|
|
64
|
+
|
|
65
|
+
<a id="sensorinterval"></a>
|
|
66
|
+
### SensorInterval
|
|
67
|
+
|
|
68
|
+
> **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
|
|
69
|
+
|
|
70
|
+
传感器监听频率。
|