@doubao-apps/ai 0.0.32 → 0.0.33
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/733.js +41 -0
- package/dist/cli.js +1 -1
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/README.md +0 -32
- package/dist/contexts/doubao-apps-dev/references/reference/open-api.md +1 -366
- package/dist/index.js +1 -1
- package/dist/manifest.json +2 -2
- package/dist/skills/doubao-apps-dev/SKILL.md +4 -5
- package/dist/skills/doubao-apps-dev/references/reference/open-api/README.md +0 -32
- package/dist/skills/doubao-apps-dev/references/reference/open-api.md +1 -366
- package/dist/skills/h5-to-doubao/SKILL.md +1 -1
- package/package.json +1 -1
- package/dist/994.js +0 -41
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +0 -536
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/02-/345/256/232/344/275/215.md +0 -359
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/03-/345/255/230/345/202/250.md +0 -409
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/04-/350/267/257/347/224/261.md +0 -165
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/05-/347/225/214/351/235/242-/344/272/244/344/272/222.md +0 -432
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/06-/347/225/214/351/235/242-/350/276/223/345/205/245.md +0 -72
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/07-/347/275/221/347/273/234.md +0 -468
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/08-/345/252/222/344/275/223.md +0 -346
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/09-/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 +0 -1238
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/10-/346/225/260/346/215/256/345/210/206/346/236/220.md +0 -67
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/11-/350/256/276/345/244/207-/350/223/235/347/211/231.md +0 -961
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/12-/350/256/276/345/244/207-wi-fi.md +0 -311
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/13-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +0 -104
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/14-/350/256/276/345/244/207-ibeacon.md +0 -148
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/15-/350/256/276/345/244/207-/347/275/227/347/233/230.md +0 -82
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/16-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +0 -104
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/17-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +0 -104
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/18-ui-/350/276/223/345/205/245.md +0 -49
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/19-/350/256/276/345/244/207-/347/275/221/347/273/234.md +0 -164
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/20-/350/256/276/345/244/207-/347/237/255/344/277/241.md +0 -62
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/21-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +0 -43
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/22-/350/256/276/345/244/207-/345/237/272/347/241/200/344/277/241/346/201/257.md +0 -133
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/23-/350/256/276/345/244/207-/347/224/265/346/261/240.md +0 -83
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/24-/350/256/276/345/244/207-/346/227/245/345/216/206.md +0 -215
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/25-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +0 -70
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/26-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +0 -270
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/27-/350/256/276/345/244/207-/345/212/240/345/257/206.md +0 -56
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/28-/350/256/276/345/244/207-/347/224/265/350/257/235.md +0 -41
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/29-/350/256/276/345/244/207-/346/211/253/347/240/201.md +0 -100
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/30-/350/256/276/345/244/207-/345/261/217/345/271/225.md +0 -173
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/31-/350/256/276/345/244/207-/351/234/207/345/212/250.md +0 -66
- package/dist/contexts/doubao-apps-dev/references/reference/open-api/32-/346/226/207/344/273/266/347/263/273/347/273/237.md +0 -1043
- package/dist/skills/doubao-apps-dev/references/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +0 -536
- package/dist/skills/doubao-apps-dev/references/reference/open-api/02-/345/256/232/344/275/215.md +0 -359
- package/dist/skills/doubao-apps-dev/references/reference/open-api/03-/345/255/230/345/202/250.md +0 -409
- package/dist/skills/doubao-apps-dev/references/reference/open-api/04-/350/267/257/347/224/261.md +0 -165
- package/dist/skills/doubao-apps-dev/references/reference/open-api/05-/347/225/214/351/235/242-/344/272/244/344/272/222.md +0 -432
- package/dist/skills/doubao-apps-dev/references/reference/open-api/06-/347/225/214/351/235/242-/350/276/223/345/205/245.md +0 -72
- package/dist/skills/doubao-apps-dev/references/reference/open-api/07-/347/275/221/347/273/234.md +0 -468
- package/dist/skills/doubao-apps-dev/references/reference/open-api/08-/345/252/222/344/275/223.md +0 -346
- package/dist/skills/doubao-apps-dev/references/reference/open-api/09-/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 +0 -1238
- package/dist/skills/doubao-apps-dev/references/reference/open-api/10-/346/225/260/346/215/256/345/210/206/346/236/220.md +0 -67
- package/dist/skills/doubao-apps-dev/references/reference/open-api/11-/350/256/276/345/244/207-/350/223/235/347/211/231.md +0 -961
- package/dist/skills/doubao-apps-dev/references/reference/open-api/12-/350/256/276/345/244/207-wi-fi.md +0 -311
- package/dist/skills/doubao-apps-dev/references/reference/open-api/13-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +0 -104
- package/dist/skills/doubao-apps-dev/references/reference/open-api/14-/350/256/276/345/244/207-ibeacon.md +0 -148
- package/dist/skills/doubao-apps-dev/references/reference/open-api/15-/350/256/276/345/244/207-/347/275/227/347/233/230.md +0 -82
- package/dist/skills/doubao-apps-dev/references/reference/open-api/16-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +0 -104
- package/dist/skills/doubao-apps-dev/references/reference/open-api/17-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +0 -104
- package/dist/skills/doubao-apps-dev/references/reference/open-api/18-ui-/350/276/223/345/205/245.md +0 -49
- package/dist/skills/doubao-apps-dev/references/reference/open-api/19-/350/256/276/345/244/207-/347/275/221/347/273/234.md +0 -164
- package/dist/skills/doubao-apps-dev/references/reference/open-api/20-/350/256/276/345/244/207-/347/237/255/344/277/241.md +0 -62
- package/dist/skills/doubao-apps-dev/references/reference/open-api/21-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +0 -43
- package/dist/skills/doubao-apps-dev/references/reference/open-api/22-/350/256/276/345/244/207-/345/237/272/347/241/200/344/277/241/346/201/257.md +0 -133
- package/dist/skills/doubao-apps-dev/references/reference/open-api/23-/350/256/276/345/244/207-/347/224/265/346/261/240.md +0 -83
- package/dist/skills/doubao-apps-dev/references/reference/open-api/24-/350/256/276/345/244/207-/346/227/245/345/216/206.md +0 -215
- package/dist/skills/doubao-apps-dev/references/reference/open-api/25-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +0 -70
- package/dist/skills/doubao-apps-dev/references/reference/open-api/26-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +0 -270
- package/dist/skills/doubao-apps-dev/references/reference/open-api/27-/350/256/276/345/244/207-/345/212/240/345/257/206.md +0 -56
- package/dist/skills/doubao-apps-dev/references/reference/open-api/28-/350/256/276/345/244/207-/347/224/265/350/257/235.md +0 -41
- package/dist/skills/doubao-apps-dev/references/reference/open-api/29-/350/256/276/345/244/207-/346/211/253/347/240/201.md +0 -100
- package/dist/skills/doubao-apps-dev/references/reference/open-api/30-/350/256/276/345/244/207-/345/261/217/345/271/225.md +0 -173
- package/dist/skills/doubao-apps-dev/references/reference/open-api/31-/350/256/276/345/244/207-/351/234/207/345/212/250.md +0 -66
- package/dist/skills/doubao-apps-dev/references/reference/open-api/32-/346/226/207/344/273/266/347/263/273/347/273/237.md +0 -1043
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
| [onDeviceMotionChange](#ondevicemotionchange) | 监听设备方向变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
-
|
|
15
|
-
## API 详情
|
|
16
|
-
|
|
17
|
-
<a id="startdevicemotionlistening"></a>
|
|
18
|
-
### startDeviceMotionListening()
|
|
19
|
-
|
|
20
|
-
> **startDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
21
|
-
|
|
22
|
-
开始监听设备方向变化。
|
|
23
|
-
|
|
24
|
-
#### Parameters
|
|
25
|
-
|
|
26
|
-
• **params?**: [`StartDeviceMotionListeningParams`](#startdevicemotionlisteningparams)
|
|
27
|
-
|
|
28
|
-
#### Returns
|
|
29
|
-
|
|
30
|
-
`Promise`\<`object`\>
|
|
31
|
-
|
|
32
|
-
#### Remarks
|
|
33
|
-
|
|
34
|
-
需配对调用 stopDeviceMotionListening。
|
|
35
|
-
|
|
36
|
-
<a id="stopdevicemotionlistening"></a>
|
|
37
|
-
### stopDeviceMotionListening()
|
|
38
|
-
|
|
39
|
-
> **stopDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
40
|
-
|
|
41
|
-
停止监听设备方向变化。
|
|
42
|
-
|
|
43
|
-
#### Parameters
|
|
44
|
-
|
|
45
|
-
• **params?**
|
|
46
|
-
|
|
47
|
-
#### Returns
|
|
48
|
-
|
|
49
|
-
`Promise`\<`object`\>
|
|
50
|
-
|
|
51
|
-
<a id="ondevicemotionchange"></a>
|
|
52
|
-
### onDeviceMotionChange()
|
|
53
|
-
|
|
54
|
-
> **onDeviceMotionChange**(`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 { onDeviceMotionChange } from '@doubao-apps/framework/api';
|
|
76
|
-
|
|
77
|
-
const off = onDeviceMotionChange(({ alpha, beta, gamma }) => {
|
|
78
|
-
console.log(alpha, beta, gamma);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
off();
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 相关类型
|
|
85
|
-
|
|
86
|
-
<a id="startdevicemotionlisteningparams"></a>
|
|
87
|
-
### StartDeviceMotionListeningParams
|
|
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
|
-
传感器监听频率。
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# Open API: 设备 / 陀螺仪
|
|
2
|
-
|
|
3
|
-
陀螺仪监听能力。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [startGyroscope](#startgyroscope) | 开始监听陀螺仪。<br><br>需配对调用 stopGyroscope。 |
|
|
12
|
-
| [stopGyroscope](#stopgyroscope) | 停止监听陀螺仪。 |
|
|
13
|
-
| [onGyroscopeChange](#ongyroscopechange) | 监听陀螺仪数据变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
-
|
|
15
|
-
## API 详情
|
|
16
|
-
|
|
17
|
-
<a id="startgyroscope"></a>
|
|
18
|
-
### startGyroscope()
|
|
19
|
-
|
|
20
|
-
> **startGyroscope**(`params`?): `Promise`\<`object`\>
|
|
21
|
-
|
|
22
|
-
开始监听陀螺仪。
|
|
23
|
-
|
|
24
|
-
#### Parameters
|
|
25
|
-
|
|
26
|
-
• **params?**: [`StartGyroscopeParams`](#startgyroscopeparams)
|
|
27
|
-
|
|
28
|
-
#### Returns
|
|
29
|
-
|
|
30
|
-
`Promise`\<`object`\>
|
|
31
|
-
|
|
32
|
-
#### Remarks
|
|
33
|
-
|
|
34
|
-
需配对调用 stopGyroscope。
|
|
35
|
-
|
|
36
|
-
<a id="stopgyroscope"></a>
|
|
37
|
-
### stopGyroscope()
|
|
38
|
-
|
|
39
|
-
> **stopGyroscope**(`params`?): `Promise`\<`object`\>
|
|
40
|
-
|
|
41
|
-
停止监听陀螺仪。
|
|
42
|
-
|
|
43
|
-
#### Parameters
|
|
44
|
-
|
|
45
|
-
• **params?**
|
|
46
|
-
|
|
47
|
-
#### Returns
|
|
48
|
-
|
|
49
|
-
`Promise`\<`object`\>
|
|
50
|
-
|
|
51
|
-
<a id="ongyroscopechange"></a>
|
|
52
|
-
### onGyroscopeChange()
|
|
53
|
-
|
|
54
|
-
> **onGyroscopeChange**(`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 { onGyroscopeChange } from '@doubao-apps/framework/api';
|
|
76
|
-
|
|
77
|
-
const off = onGyroscopeChange(({ x, y, z, timestamp }) => {
|
|
78
|
-
console.log(x, y, z, timestamp);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
off();
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 相关类型
|
|
85
|
-
|
|
86
|
-
<a id="startgyroscopeparams"></a>
|
|
87
|
-
### StartGyroscopeParams
|
|
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
|
-
传感器监听频率。
|
package/dist/skills/doubao-apps-dev/references/reference/open-api/18-ui-/350/276/223/345/205/245.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Open API: UI / 输入
|
|
2
|
-
|
|
3
|
-
键盘和输入框选区能力。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [getSelectedTextRange](#getselectedtextrange) | 获取当前输入框的选区范围。 |
|
|
12
|
-
|
|
13
|
-
## API 详情
|
|
14
|
-
|
|
15
|
-
<a id="getselectedtextrange"></a>
|
|
16
|
-
### getSelectedTextRange()
|
|
17
|
-
|
|
18
|
-
> **getSelectedTextRange**(`params`?): `Promise`\<[`GetSelectedTextRangeResult`](#getselectedtextrangeresult)\>
|
|
19
|
-
|
|
20
|
-
获取当前输入框的选区范围。
|
|
21
|
-
|
|
22
|
-
#### Parameters
|
|
23
|
-
|
|
24
|
-
• **params?**
|
|
25
|
-
|
|
26
|
-
#### Returns
|
|
27
|
-
|
|
28
|
-
`Promise`\<[`GetSelectedTextRangeResult`](#getselectedtextrangeresult)\>
|
|
29
|
-
|
|
30
|
-
## 相关类型
|
|
31
|
-
|
|
32
|
-
<a id="getselectedtextrangeresult"></a>
|
|
33
|
-
### GetSelectedTextRangeResult
|
|
34
|
-
|
|
35
|
-
获取输入框选区范围的返回结果。
|
|
36
|
-
|
|
37
|
-
#### Properties
|
|
38
|
-
|
|
39
|
-
##### end
|
|
40
|
-
|
|
41
|
-
> **end**: `number`
|
|
42
|
-
|
|
43
|
-
选区结束位置。
|
|
44
|
-
|
|
45
|
-
##### start
|
|
46
|
-
|
|
47
|
-
> **start**: `number`
|
|
48
|
-
|
|
49
|
-
选区起始位置。
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
# Open API: 设备 / 网络
|
|
2
|
-
|
|
3
|
-
网络类型和本机局域网 IP。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [getLocalIPAddress](#getlocalipaddress) | 获取局域网 IP 地址。 |
|
|
12
|
-
| [getNetworkType](#getnetworktype) | 获取当前网络类型。 |
|
|
13
|
-
| [onNetworkStatusChange](#onnetworkstatuschange) | 监听网络状态变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
-
|
|
15
|
-
## API 详情
|
|
16
|
-
|
|
17
|
-
<a id="getlocalipaddress"></a>
|
|
18
|
-
### getLocalIPAddress()
|
|
19
|
-
|
|
20
|
-
> **getLocalIPAddress**(`params`?): `Promise`\<[`GetLocalIPAddressResult`](#getlocalipaddressresult)\>
|
|
21
|
-
|
|
22
|
-
获取局域网 IP 地址。
|
|
23
|
-
|
|
24
|
-
#### Parameters
|
|
25
|
-
|
|
26
|
-
• **params?**
|
|
27
|
-
|
|
28
|
-
#### Returns
|
|
29
|
-
|
|
30
|
-
`Promise`\<[`GetLocalIPAddressResult`](#getlocalipaddressresult)\>
|
|
31
|
-
|
|
32
|
-
<a id="getnetworktype"></a>
|
|
33
|
-
### getNetworkType()
|
|
34
|
-
|
|
35
|
-
> **getNetworkType**(`params`?): `Promise`\<[`GetNetworkTypeResult`](#getnetworktyperesult)\>
|
|
36
|
-
|
|
37
|
-
获取当前网络类型。
|
|
38
|
-
|
|
39
|
-
#### Parameters
|
|
40
|
-
|
|
41
|
-
• **params?**: [`GetNetworkTypeParams`](#getnetworktypeparams)
|
|
42
|
-
|
|
43
|
-
#### Returns
|
|
44
|
-
|
|
45
|
-
`Promise`\<[`GetNetworkTypeResult`](#getnetworktyperesult)\>
|
|
46
|
-
|
|
47
|
-
返回一个 Promise,解析为 [GetNetworkTypeResult](#getnetworktyperesult)。
|
|
48
|
-
|
|
49
|
-
#### Example
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
import { getNetworkType } from '@byted-doubao-apps/framework/api';
|
|
53
|
-
|
|
54
|
-
const result = await getNetworkType();
|
|
55
|
-
console.log(result.networkType);
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
<a id="onnetworkstatuschange"></a>
|
|
59
|
-
### onNetworkStatusChange()
|
|
60
|
-
|
|
61
|
-
> **onNetworkStatusChange**(`handler`): () => `void`
|
|
62
|
-
|
|
63
|
-
监听网络状态变化事件。
|
|
64
|
-
|
|
65
|
-
#### Parameters
|
|
66
|
-
|
|
67
|
-
• **handler**
|
|
68
|
-
|
|
69
|
-
#### Returns
|
|
70
|
-
|
|
71
|
-
`Function`
|
|
72
|
-
|
|
73
|
-
返回取消当前监听函数的函数。
|
|
74
|
-
|
|
75
|
-
##### Returns
|
|
76
|
-
|
|
77
|
-
`void`
|
|
78
|
-
|
|
79
|
-
#### Example
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
import { onNetworkStatusChange } from '@byted-doubao-apps/framework/api';
|
|
83
|
-
|
|
84
|
-
const off = onNetworkStatusChange(({ isConnected, networkType }) => {
|
|
85
|
-
console.log(isConnected, networkType);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
off();
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 相关类型
|
|
92
|
-
|
|
93
|
-
<a id="getlocalipaddressresult"></a>
|
|
94
|
-
### GetLocalIPAddressResult
|
|
95
|
-
|
|
96
|
-
获取局域网 IP 的返回结果。
|
|
97
|
-
|
|
98
|
-
#### Properties
|
|
99
|
-
|
|
100
|
-
##### localIp
|
|
101
|
-
|
|
102
|
-
> **localIp**: `string`
|
|
103
|
-
|
|
104
|
-
本机局域网 IP 地址。
|
|
105
|
-
|
|
106
|
-
##### netmask?
|
|
107
|
-
|
|
108
|
-
> `optional` **netmask**: `string`
|
|
109
|
-
|
|
110
|
-
子网掩码。
|
|
111
|
-
|
|
112
|
-
<a id="getnetworktypeparams"></a>
|
|
113
|
-
### GetNetworkTypeParams
|
|
114
|
-
|
|
115
|
-
获取网络类型的请求参数。
|
|
116
|
-
|
|
117
|
-
当前无需传入任何字段,预留扩展位。
|
|
118
|
-
|
|
119
|
-
<a id="getnetworktyperesult"></a>
|
|
120
|
-
### GetNetworkTypeResult
|
|
121
|
-
|
|
122
|
-
获取网络类型的返回结果。
|
|
123
|
-
|
|
124
|
-
#### Properties
|
|
125
|
-
|
|
126
|
-
##### hasSystemProxy?
|
|
127
|
-
|
|
128
|
-
> `optional` **hasSystemProxy**: `boolean`
|
|
129
|
-
|
|
130
|
-
设备是否使用了系统代理。
|
|
131
|
-
|
|
132
|
-
##### networkType
|
|
133
|
-
|
|
134
|
-
> **networkType**: [`NetworkType`](#networktype-2)
|
|
135
|
-
|
|
136
|
-
当前网络类型。
|
|
137
|
-
|
|
138
|
-
##### signalStrength?
|
|
139
|
-
|
|
140
|
-
> `optional` **signalStrength**: `number`
|
|
141
|
-
|
|
142
|
-
信号强弱,单位 dBm。
|
|
143
|
-
|
|
144
|
-
##### weakNet?
|
|
145
|
-
|
|
146
|
-
> `optional` **weakNet**: `boolean`
|
|
147
|
-
|
|
148
|
-
是否处于弱网环境。
|
|
149
|
-
|
|
150
|
-
<a id="networktype-2"></a>
|
|
151
|
-
<a id="networktype"></a>
|
|
152
|
-
### NetworkType
|
|
153
|
-
|
|
154
|
-
> **NetworkType**: `"wifi"` \| `"2g"` \| `"3g"` \| `"4g"` \| `"5g"` \| `"unknown"` \| `"none"`
|
|
155
|
-
|
|
156
|
-
网络类型。
|
|
157
|
-
|
|
158
|
-
- `wifi` - Wi-Fi 网络
|
|
159
|
-
- `2g` - 2G 网络
|
|
160
|
-
- `3g` - 3G 网络
|
|
161
|
-
- `4g` - 4G 网络
|
|
162
|
-
- `5g` - 5G 网络
|
|
163
|
-
- `unknown` - Android 下不常见的网络类型
|
|
164
|
-
- `none` - 无网络
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Open API: 设备 / 短信
|
|
2
|
-
|
|
3
|
-
拉起系统短信发送面板。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [sendSms](#sendsms) | 拉起系统短信发送面板。 |
|
|
12
|
-
|
|
13
|
-
## API 详情
|
|
14
|
-
|
|
15
|
-
<a id="sendsms"></a>
|
|
16
|
-
### sendSms()
|
|
17
|
-
|
|
18
|
-
> **sendSms**(`params`?): `Promise`\<`object`\>
|
|
19
|
-
|
|
20
|
-
拉起系统短信发送面板。
|
|
21
|
-
|
|
22
|
-
#### Parameters
|
|
23
|
-
|
|
24
|
-
• **params?**: [`SendSmsParams`](#sendsmsparams)
|
|
25
|
-
|
|
26
|
-
#### Returns
|
|
27
|
-
|
|
28
|
-
`Promise`\<`object`\>
|
|
29
|
-
|
|
30
|
-
返回一个 Promise,在成功拉起短信发送面板时解析。
|
|
31
|
-
|
|
32
|
-
#### Example
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import { sendSms } from '@doubao-apps/framework/api';
|
|
36
|
-
|
|
37
|
-
await sendSms({
|
|
38
|
-
phoneNumber: '10086',
|
|
39
|
-
message: '查询话费'
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## 相关类型
|
|
44
|
-
|
|
45
|
-
<a id="sendsmsparams"></a>
|
|
46
|
-
### SendSmsParams
|
|
47
|
-
|
|
48
|
-
拉起系统短信发送面板的请求参数。
|
|
49
|
-
|
|
50
|
-
#### Properties
|
|
51
|
-
|
|
52
|
-
##### message?
|
|
53
|
-
|
|
54
|
-
> `optional` **message**: `string`
|
|
55
|
-
|
|
56
|
-
预填到发送短信面板的内容。
|
|
57
|
-
|
|
58
|
-
##### phoneNumber?
|
|
59
|
-
|
|
60
|
-
> `optional` **phoneNumber**: `string`
|
|
61
|
-
|
|
62
|
-
预填到发送短信面板的手机号。
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Open API: 设备 / 无障碍
|
|
2
|
-
|
|
3
|
-
检测无障碍能力开关状态。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [checkIsOpenAccessibility](#checkisopenaccessibility) | 检测无障碍能力是否开启。 |
|
|
12
|
-
|
|
13
|
-
## API 详情
|
|
14
|
-
|
|
15
|
-
<a id="checkisopenaccessibility"></a>
|
|
16
|
-
### checkIsOpenAccessibility()
|
|
17
|
-
|
|
18
|
-
> **checkIsOpenAccessibility**(`params`?): `Promise`\<[`CheckIsOpenAccessibilityResult`](#checkisopenaccessibilityresult)\>
|
|
19
|
-
|
|
20
|
-
检测无障碍能力是否开启。
|
|
21
|
-
|
|
22
|
-
#### Parameters
|
|
23
|
-
|
|
24
|
-
• **params?**
|
|
25
|
-
|
|
26
|
-
#### Returns
|
|
27
|
-
|
|
28
|
-
`Promise`\<[`CheckIsOpenAccessibilityResult`](#checkisopenaccessibilityresult)\>
|
|
29
|
-
|
|
30
|
-
## 相关类型
|
|
31
|
-
|
|
32
|
-
<a id="checkisopenaccessibilityresult"></a>
|
|
33
|
-
### CheckIsOpenAccessibilityResult
|
|
34
|
-
|
|
35
|
-
无障碍能力检测结果。
|
|
36
|
-
|
|
37
|
-
#### Properties
|
|
38
|
-
|
|
39
|
-
##### open
|
|
40
|
-
|
|
41
|
-
> **open**: `boolean`
|
|
42
|
-
|
|
43
|
-
是否开启视觉无障碍能力。
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# Open API: 设备 / 基础信息
|
|
2
|
-
|
|
3
|
-
设备品牌、型号、系统、内存和性能等级。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 说明 |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [getDeviceInfo](#getdeviceinfo) | 获取设备基础信息。 |
|
|
12
|
-
| [getDeviceInfoSync](#getdeviceinfosync) | 同步获取设备基础信息。<br><br>同步 API。 |
|
|
13
|
-
|
|
14
|
-
## API 详情
|
|
15
|
-
|
|
16
|
-
<a id="getdeviceinfo"></a>
|
|
17
|
-
### getDeviceInfo()
|
|
18
|
-
|
|
19
|
-
> **getDeviceInfo**(`params`?): `Promise`\<[`GetDeviceInfoResult`](#getdeviceinforesult)\>
|
|
20
|
-
|
|
21
|
-
获取设备基础信息。
|
|
22
|
-
|
|
23
|
-
#### Parameters
|
|
24
|
-
|
|
25
|
-
• **params?**
|
|
26
|
-
|
|
27
|
-
#### Returns
|
|
28
|
-
|
|
29
|
-
`Promise`\<[`GetDeviceInfoResult`](#getdeviceinforesult)\>
|
|
30
|
-
|
|
31
|
-
返回设备品牌、型号、系统、内存和性能等级等字段,见 [GetDeviceInfoResult](#getdeviceinforesult)。
|
|
32
|
-
|
|
33
|
-
#### Example
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
import { getDeviceInfo } from '@doubao-apps/framework/api';
|
|
37
|
-
|
|
38
|
-
const result = await getDeviceInfo();
|
|
39
|
-
|
|
40
|
-
console.log(result.brand, result.model, result.system);
|
|
41
|
-
console.log(result.platform, result.benchmarkLevel);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
<a id="getdeviceinfosync"></a>
|
|
45
|
-
### getDeviceInfoSync()
|
|
46
|
-
|
|
47
|
-
> **getDeviceInfoSync**(`params`?): [`GetDeviceInfoResult`](#getdeviceinforesult)
|
|
48
|
-
|
|
49
|
-
同步获取设备基础信息。
|
|
50
|
-
|
|
51
|
-
#### Parameters
|
|
52
|
-
|
|
53
|
-
• **params?**
|
|
54
|
-
|
|
55
|
-
#### Returns
|
|
56
|
-
|
|
57
|
-
[`GetDeviceInfoResult`](#getdeviceinforesult)
|
|
58
|
-
|
|
59
|
-
返回设备品牌、型号、系统、内存和性能等级等字段,见 [GetDeviceInfoResult](#getdeviceinforesult)。
|
|
60
|
-
|
|
61
|
-
#### Example
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
import { getDeviceInfoSync } from '@doubao-apps/framework/api';
|
|
65
|
-
|
|
66
|
-
const result = getDeviceInfoSync();
|
|
67
|
-
|
|
68
|
-
console.log(result.brand, result.model, result.system);
|
|
69
|
-
console.log(result.platform, result.benchmarkLevel);
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## 相关类型
|
|
73
|
-
|
|
74
|
-
<a id="getdeviceinforesult"></a>
|
|
75
|
-
### GetDeviceInfoResult
|
|
76
|
-
|
|
77
|
-
设备基础信息。
|
|
78
|
-
|
|
79
|
-
#### Properties
|
|
80
|
-
|
|
81
|
-
##### abi?
|
|
82
|
-
|
|
83
|
-
> `optional` **abi**: `string`
|
|
84
|
-
|
|
85
|
-
宿主 App 二进制接口类型,仅 Android 支持。
|
|
86
|
-
|
|
87
|
-
##### benchmarkLevel
|
|
88
|
-
|
|
89
|
-
> **benchmarkLevel**: `number`
|
|
90
|
-
|
|
91
|
-
设备性能等级,值越高性能越好;-1 表示未知。
|
|
92
|
-
|
|
93
|
-
##### brand
|
|
94
|
-
|
|
95
|
-
> **brand**: `string`
|
|
96
|
-
|
|
97
|
-
设备品牌。
|
|
98
|
-
|
|
99
|
-
##### cpuType?
|
|
100
|
-
|
|
101
|
-
> `optional` **cpuType**: `string`
|
|
102
|
-
|
|
103
|
-
设备 CPU 型号,仅 Android 支持。
|
|
104
|
-
|
|
105
|
-
##### deviceAbi?
|
|
106
|
-
|
|
107
|
-
> `optional` **deviceAbi**: `string`
|
|
108
|
-
|
|
109
|
-
设备二进制接口类型,仅 Android 支持。
|
|
110
|
-
|
|
111
|
-
##### memorySize
|
|
112
|
-
|
|
113
|
-
> **memorySize**: `string`
|
|
114
|
-
|
|
115
|
-
设备内存大小,单位 MB。
|
|
116
|
-
|
|
117
|
-
##### model
|
|
118
|
-
|
|
119
|
-
> **model**: `string`
|
|
120
|
-
|
|
121
|
-
设备型号。
|
|
122
|
-
|
|
123
|
-
##### platform
|
|
124
|
-
|
|
125
|
-
> **platform**: `string`
|
|
126
|
-
|
|
127
|
-
客户端平台。
|
|
128
|
-
|
|
129
|
-
##### system
|
|
130
|
-
|
|
131
|
-
> **system**: `string`
|
|
132
|
-
|
|
133
|
-
操作系统及版本。
|