@doubao-apps/create 0.0.26 → 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 +13 -13
- package/dist/template-empty/.ai/reference/open-api/{02-storage.md → 02-/345/255/230/345/202/250.md} +13 -21
- package/dist/template-empty/.ai/reference/open-api/{03-router.md → 03-/350/267/257/347/224/261.md} +9 -9
- package/dist/{template-starter/.ai/reference/open-api/04-ui- → template-empty/.ai/reference/open-api/04-/347/225/214/351/235/242-}/344/272/244/344/272/222.md +12 -12
- 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-media.md → 07-/345/252/222/344/275/223.md} +8 -8
- package/dist/template-empty/.ai/reference/open-api/{08-open- → 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 +83 -14
- package/dist/{template-starter/.ai/reference/open-api/09-device-bluetooth.md → template-empty/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md} +22 -46
- package/dist/{template-starter/.ai/reference/open-api/10-device-wi-fi.md → template-empty/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md} +9 -9
- 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 +27 -11
- package/dist/template-empty/.ai/reference/open-api.md +275 -8
- package/dist/template-empty/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-empty/AGENTS.md +54 -31
- 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 +13 -13
- package/dist/template-starter/.ai/reference/open-api/{02-storage.md → 02-/345/255/230/345/202/250.md} +13 -21
- package/dist/template-starter/.ai/reference/open-api/{03-router.md → 03-/350/267/257/347/224/261.md} +9 -9
- package/dist/{template-empty/.ai/reference/open-api/04-ui- → template-starter/.ai/reference/open-api/04-/347/225/214/351/235/242-}/344/272/244/344/272/222.md +12 -12
- 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-media.md → 07-/345/252/222/344/275/223.md} +8 -8
- package/dist/template-starter/.ai/reference/open-api/{08-open- → 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 +83 -14
- package/dist/{template-empty/.ai/reference/open-api/09-device-bluetooth.md → template-starter/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md} +22 -46
- package/dist/{template-empty/.ai/reference/open-api/10-device-wi-fi.md → template-starter/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md} +9 -9
- 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 +27 -11
- package/dist/template-starter/.ai/reference/open-api.md +275 -8
- package/dist/template-starter/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-starter/AGENTS.md +54 -31
- 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
- package/dist/template-empty/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +0 -95
- package/dist/template-empty/.ai/reference/open-api/06-network.md +0 -298
- package/dist/template-empty/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +0 -372
- package/dist/template-empty/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +0 -1005
- package/dist/template-starter/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +0 -95
- package/dist/template-starter/.ai/reference/open-api/06-network.md +0 -298
- package/dist/template-starter/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +0 -372
- package/dist/template-starter/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +0 -1005
package/package.json
CHANGED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Open API: UI / 输入
|
|
2
|
-
|
|
3
|
-
键盘和输入框选区能力。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 签名 | 用途 | 参数类型 | 结果类型 | 注意点 |
|
|
10
|
-
| --- | --- | --- | --- | --- | --- |
|
|
11
|
-
| [`onKeyboardHeightChange`](#onkeyboardheightchange) | `onKeyboardHeightChange(handler): () => void` | 监听键盘高度变化事件 | `handler` | `() => void` | 返回取消监听函数 |
|
|
12
|
-
| [`hideKeyboard`](#hidekeyboard) | `hideKeyboard(params?): Promise<object>` | 收起键盘 | `params?` | `Promise<object>` | - |
|
|
13
|
-
| [`getSelectedTextRange`](#getselectedtextrange) | `getSelectedTextRange(params?): Promise<GetSelectedTextRangeResult>` | 获取当前输入框的选区范围 | `params?` | `Promise<GetSelectedTextRangeResult>` | - |
|
|
14
|
-
|
|
15
|
-
## API 详情
|
|
16
|
-
|
|
17
|
-
<a id="onkeyboardheightchange"></a>
|
|
18
|
-
### onKeyboardHeightChange()
|
|
19
|
-
|
|
20
|
-
> **onKeyboardHeightChange**(`handler`): () => `void`
|
|
21
|
-
|
|
22
|
-
监听键盘高度变化事件。
|
|
23
|
-
|
|
24
|
-
#### Parameters
|
|
25
|
-
|
|
26
|
-
• **handler**
|
|
27
|
-
|
|
28
|
-
#### Returns
|
|
29
|
-
|
|
30
|
-
`Function`
|
|
31
|
-
|
|
32
|
-
##### Returns
|
|
33
|
-
|
|
34
|
-
`void`
|
|
35
|
-
|
|
36
|
-
#### Example
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import { onKeyboardHeightChange } from '@doubao-apps/framework/api';
|
|
40
|
-
|
|
41
|
-
const unsubscribe = onKeyboardHeightChange(({ height }) => {
|
|
42
|
-
console.log('Keyboard height change event:', { height });
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
<a id="hidekeyboard"></a>
|
|
47
|
-
### hideKeyboard()
|
|
48
|
-
|
|
49
|
-
> **hideKeyboard**(`params`?): `Promise`\<`object`\>
|
|
50
|
-
|
|
51
|
-
收起键盘。
|
|
52
|
-
|
|
53
|
-
#### Parameters
|
|
54
|
-
|
|
55
|
-
• **params?**
|
|
56
|
-
|
|
57
|
-
#### Returns
|
|
58
|
-
|
|
59
|
-
`Promise`\<`object`\>
|
|
60
|
-
|
|
61
|
-
<a id="getselectedtextrange"></a>
|
|
62
|
-
### getSelectedTextRange()
|
|
63
|
-
|
|
64
|
-
> **getSelectedTextRange**(`params`?): `Promise`\<[`GetSelectedTextRangeResult`](#getselectedtextrangeresult)\>
|
|
65
|
-
|
|
66
|
-
获取当前输入框的选区范围。
|
|
67
|
-
|
|
68
|
-
#### Parameters
|
|
69
|
-
|
|
70
|
-
• **params?**
|
|
71
|
-
|
|
72
|
-
#### Returns
|
|
73
|
-
|
|
74
|
-
`Promise`\<[`GetSelectedTextRangeResult`](#getselectedtextrangeresult)\>
|
|
75
|
-
|
|
76
|
-
## 相关类型
|
|
77
|
-
|
|
78
|
-
<a id="getselectedtextrangeresult"></a>
|
|
79
|
-
### GetSelectedTextRangeResult
|
|
80
|
-
|
|
81
|
-
获取输入框选区范围的返回结果。
|
|
82
|
-
|
|
83
|
-
#### Properties
|
|
84
|
-
|
|
85
|
-
##### end
|
|
86
|
-
|
|
87
|
-
> **end**: `number`
|
|
88
|
-
|
|
89
|
-
选区结束位置。
|
|
90
|
-
|
|
91
|
-
##### start
|
|
92
|
-
|
|
93
|
-
> **start**: `number`
|
|
94
|
-
|
|
95
|
-
选区起始位置。
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
# Open API: Network
|
|
2
|
-
|
|
3
|
-
网络请求、网络类型和本机局域网 IP。
|
|
4
|
-
|
|
5
|
-
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
-
|
|
7
|
-
## 速查
|
|
8
|
-
|
|
9
|
-
| API | 签名 | 用途 | 参数类型 | 结果类型 | 注意点 |
|
|
10
|
-
| --- | --- | --- | --- | --- | --- |
|
|
11
|
-
| [`request`](#request) | `request(params): Promise<RequestResponse>` | 发起网络请求 | `params: RequestParams` | `Promise<RequestResponse>` | 返回 statusCode、header 和 data |
|
|
12
|
-
| [`getNetworkType`](#getnetworktype) | `getNetworkType(params?): Promise<GetNetworkTypeResult>` | 获取当前网络类型 | `params?: GetNetworkTypeParams` | `Promise<GetNetworkTypeResult>` | - |
|
|
13
|
-
| [`onNetworkStatusChange`](#onnetworkstatuschange) | `onNetworkStatusChange(handler): () => void` | 监听网络状态变化事件 | `handler` | `() => void` | 返回取消监听函数 |
|
|
14
|
-
| [`getLocalIPAddress`](#getlocalipaddress) | `getLocalIPAddress(params?): Promise<GetLocalIPAddressResult>` | 获取局域网 IP 地址 | `params?` | `Promise<GetLocalIPAddressResult>` | - |
|
|
15
|
-
|
|
16
|
-
## API 详情
|
|
17
|
-
|
|
18
|
-
<a id="request"></a>
|
|
19
|
-
### request()
|
|
20
|
-
|
|
21
|
-
> **request**(`params`): `Promise`\<[`RequestResponse`](#requestresponse)\>
|
|
22
|
-
|
|
23
|
-
发起网络请求。
|
|
24
|
-
|
|
25
|
-
#### Parameters
|
|
26
|
-
|
|
27
|
-
• **params**: [`RequestParams`](#requestparams)
|
|
28
|
-
|
|
29
|
-
请求参数,字段见 [RequestParams](#requestparams)。
|
|
30
|
-
|
|
31
|
-
#### Returns
|
|
32
|
-
|
|
33
|
-
`Promise`\<[`RequestResponse`](#requestresponse)\>
|
|
34
|
-
|
|
35
|
-
返回一个 Promise,解析为 [RequestResponse](#requestresponse)。
|
|
36
|
-
|
|
37
|
-
#### Remarks
|
|
38
|
-
|
|
39
|
-
返回 statusCode、header 和 data。
|
|
40
|
-
|
|
41
|
-
#### Example
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { request } from '@doubao-apps/framework/api';
|
|
45
|
-
|
|
46
|
-
const result = await request({
|
|
47
|
-
url: 'https://postman-echo.com/post',
|
|
48
|
-
method: 'POST',
|
|
49
|
-
dataType: 'json',
|
|
50
|
-
header: { 'content-type': 'application/json' },
|
|
51
|
-
data: { hello: 'world' }
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
console.log(result.statusCode, result.data);
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
<a id="getnetworktype"></a>
|
|
58
|
-
### getNetworkType()
|
|
59
|
-
|
|
60
|
-
> **getNetworkType**(`params`?): `Promise`\<[`GetNetworkTypeResult`](#getnetworktyperesult)\>
|
|
61
|
-
|
|
62
|
-
获取当前网络类型。
|
|
63
|
-
|
|
64
|
-
#### Parameters
|
|
65
|
-
|
|
66
|
-
• **params?**: [`GetNetworkTypeParams`](#getnetworktypeparams)
|
|
67
|
-
|
|
68
|
-
#### Returns
|
|
69
|
-
|
|
70
|
-
`Promise`\<[`GetNetworkTypeResult`](#getnetworktyperesult)\>
|
|
71
|
-
|
|
72
|
-
返回一个 Promise,解析为 [GetNetworkTypeResult](#getnetworktyperesult)。
|
|
73
|
-
|
|
74
|
-
#### Example
|
|
75
|
-
|
|
76
|
-
```ts
|
|
77
|
-
import { getNetworkType } from '@doubao-apps/framework/api';
|
|
78
|
-
|
|
79
|
-
const result = await getNetworkType();
|
|
80
|
-
console.log(result.networkType);
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
<a id="onnetworkstatuschange"></a>
|
|
84
|
-
### onNetworkStatusChange()
|
|
85
|
-
|
|
86
|
-
> **onNetworkStatusChange**(`handler`): () => `void`
|
|
87
|
-
|
|
88
|
-
监听网络状态变化事件。
|
|
89
|
-
|
|
90
|
-
#### Parameters
|
|
91
|
-
|
|
92
|
-
• **handler**
|
|
93
|
-
|
|
94
|
-
#### Returns
|
|
95
|
-
|
|
96
|
-
`Function`
|
|
97
|
-
|
|
98
|
-
返回取消当前监听函数的函数。
|
|
99
|
-
|
|
100
|
-
##### Returns
|
|
101
|
-
|
|
102
|
-
`void`
|
|
103
|
-
|
|
104
|
-
#### Example
|
|
105
|
-
|
|
106
|
-
```ts
|
|
107
|
-
import { onNetworkStatusChange } from '@doubao-apps/framework/api';
|
|
108
|
-
|
|
109
|
-
const off = onNetworkStatusChange(({ isConnected, networkType }) => {
|
|
110
|
-
console.log(isConnected, networkType);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
off();
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
<a id="getlocalipaddress"></a>
|
|
117
|
-
### getLocalIPAddress()
|
|
118
|
-
|
|
119
|
-
> **getLocalIPAddress**(`params`?): `Promise`\<[`GetLocalIPAddressResult`](#getlocalipaddressresult)\>
|
|
120
|
-
|
|
121
|
-
获取局域网 IP 地址。
|
|
122
|
-
|
|
123
|
-
#### Parameters
|
|
124
|
-
|
|
125
|
-
• **params?**
|
|
126
|
-
|
|
127
|
-
#### Returns
|
|
128
|
-
|
|
129
|
-
`Promise`\<[`GetLocalIPAddressResult`](#getlocalipaddressresult)\>
|
|
130
|
-
|
|
131
|
-
## 相关类型
|
|
132
|
-
|
|
133
|
-
<a id="requestparams"></a>
|
|
134
|
-
### RequestParams
|
|
135
|
-
|
|
136
|
-
网络请求参数。
|
|
137
|
-
|
|
138
|
-
#### Properties
|
|
139
|
-
|
|
140
|
-
##### data?
|
|
141
|
-
|
|
142
|
-
> `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
|
|
143
|
-
|
|
144
|
-
请求体数据。
|
|
145
|
-
|
|
146
|
-
传给服务器的数据最终会是 `String` 或 `ArrayBuffer`:
|
|
147
|
-
- 若 `data` 是 `string` 或 `ArrayBuffer`,直接使用;
|
|
148
|
-
- 若 `header['content-type']` 是 `application/x-www-form-urlencoded`,会被编码为 query string,例如:`encodeURIComponent(k)=encodeURIComponent(v)`;
|
|
149
|
-
- 若 `header['content-type']` 是 `application/json`,会执行 JSON 序列化;
|
|
150
|
-
- 若 `data` 是普通对象且未命中上述类型,也会执行 JSON 序列化;
|
|
151
|
-
- 其他类型会调用 `toString()`
|
|
152
|
-
|
|
153
|
-
##### dataType?
|
|
154
|
-
|
|
155
|
-
> `optional` **dataType**: `"string"` \| `"json"`
|
|
156
|
-
|
|
157
|
-
期望返回的数据格式。
|
|
158
|
-
- `json`: 尝试按 JSON 解析;
|
|
159
|
-
- `string`: 按字符串返回。
|
|
160
|
-
|
|
161
|
-
###### Default
|
|
162
|
-
|
|
163
|
-
```ts
|
|
164
|
-
"json"
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
##### header?
|
|
168
|
-
|
|
169
|
-
> `optional` **header**: `Record`\<`string`, `string`\>
|
|
170
|
-
|
|
171
|
-
请求 Header。
|
|
172
|
-
|
|
173
|
-
###### Default
|
|
174
|
-
|
|
175
|
-
```ts
|
|
176
|
-
{"content-type": "application/json"}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
##### method?
|
|
180
|
-
|
|
181
|
-
> `optional` **method**: [`RequestMethod`](#requestmethod)
|
|
182
|
-
|
|
183
|
-
请求方法。
|
|
184
|
-
|
|
185
|
-
###### Default
|
|
186
|
-
|
|
187
|
-
```ts
|
|
188
|
-
"GET"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
##### url
|
|
192
|
-
|
|
193
|
-
> **url**: `string`
|
|
194
|
-
|
|
195
|
-
请求地址,需为完整的 **HTTPS** URL。
|
|
196
|
-
|
|
197
|
-
<a id="requestresponse"></a>
|
|
198
|
-
### RequestResponse
|
|
199
|
-
|
|
200
|
-
网络请求返回结果。
|
|
201
|
-
|
|
202
|
-
#### Properties
|
|
203
|
-
|
|
204
|
-
##### data?
|
|
205
|
-
|
|
206
|
-
> `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
|
|
207
|
-
|
|
208
|
-
响应数据,类型由 `dataType` 决定。
|
|
209
|
-
|
|
210
|
-
##### header
|
|
211
|
-
|
|
212
|
-
> **header**: `Record`\<`string`, `string`\>
|
|
213
|
-
|
|
214
|
-
HTTP 响应头。
|
|
215
|
-
|
|
216
|
-
##### statusCode
|
|
217
|
-
|
|
218
|
-
> **statusCode**: `number`
|
|
219
|
-
|
|
220
|
-
HTTP 状态码。
|
|
221
|
-
|
|
222
|
-
<a id="requestmethod"></a>
|
|
223
|
-
### RequestMethod
|
|
224
|
-
|
|
225
|
-
> **RequestMethod**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"HEAD"` \| `"OPTIONS"` \| `"TRACE"` \| `"CONNECT"`
|
|
226
|
-
|
|
227
|
-
<a id="getnetworktypeparams"></a>
|
|
228
|
-
### GetNetworkTypeParams
|
|
229
|
-
|
|
230
|
-
获取网络类型的请求参数。
|
|
231
|
-
|
|
232
|
-
当前无需传入任何字段,预留扩展位。
|
|
233
|
-
|
|
234
|
-
<a id="getnetworktyperesult"></a>
|
|
235
|
-
### GetNetworkTypeResult
|
|
236
|
-
|
|
237
|
-
获取网络类型的返回结果。
|
|
238
|
-
|
|
239
|
-
#### Properties
|
|
240
|
-
|
|
241
|
-
##### hasSystemProxy?
|
|
242
|
-
|
|
243
|
-
> `optional` **hasSystemProxy**: `boolean`
|
|
244
|
-
|
|
245
|
-
设备是否使用了系统代理。
|
|
246
|
-
|
|
247
|
-
##### networkType
|
|
248
|
-
|
|
249
|
-
> **networkType**: [`NetworkType`](#networktype-2)
|
|
250
|
-
|
|
251
|
-
当前网络类型。
|
|
252
|
-
|
|
253
|
-
##### signalStrength?
|
|
254
|
-
|
|
255
|
-
> `optional` **signalStrength**: `number`
|
|
256
|
-
|
|
257
|
-
信号强弱,单位 dBm。
|
|
258
|
-
|
|
259
|
-
##### weakNet?
|
|
260
|
-
|
|
261
|
-
> `optional` **weakNet**: `boolean`
|
|
262
|
-
|
|
263
|
-
是否处于弱网环境。
|
|
264
|
-
|
|
265
|
-
<a id="networktype-2"></a>
|
|
266
|
-
<a id="networktype"></a>
|
|
267
|
-
### NetworkType
|
|
268
|
-
|
|
269
|
-
> **NetworkType**: `"wifi"` \| `"2g"` \| `"3g"` \| `"4g"` \| `"5g"` \| `"unknown"` \| `"none"`
|
|
270
|
-
|
|
271
|
-
网络类型。
|
|
272
|
-
|
|
273
|
-
- `wifi` - Wi-Fi 网络
|
|
274
|
-
- `2g` - 2G 网络
|
|
275
|
-
- `3g` - 3G 网络
|
|
276
|
-
- `4g` - 4G 网络
|
|
277
|
-
- `5g` - 5G 网络
|
|
278
|
-
- `unknown` - Android 下不常见的网络类型
|
|
279
|
-
- `none` - 无网络
|
|
280
|
-
|
|
281
|
-
<a id="getlocalipaddressresult"></a>
|
|
282
|
-
### GetLocalIPAddressResult
|
|
283
|
-
|
|
284
|
-
获取局域网 IP 的返回结果。
|
|
285
|
-
|
|
286
|
-
#### Properties
|
|
287
|
-
|
|
288
|
-
##### localIp
|
|
289
|
-
|
|
290
|
-
> **localIp**: `string`
|
|
291
|
-
|
|
292
|
-
本机局域网 IP 地址。
|
|
293
|
-
|
|
294
|
-
##### netmask?
|
|
295
|
-
|
|
296
|
-
> `optional` **netmask**: `string`
|
|
297
|
-
|
|
298
|
-
子网掩码。
|