提交 c5b3eb2d 编写于 作者: W wangdongqi

Signed-off-by: wangdongqi <wangdongqi2@huawei.com>

 Changes to be committed:

 Changes to be committed:

 Changes to be committed:
上级 ffb08b0e
......@@ -1692,11 +1692,11 @@ off(type: 'insertText'): void
inputMethodController.off('insertText');
```
### on('deleteLeft' | 'deleteRight')<sup>10+</sup>
### on('deleteLeft')<sup>10+</sup>
on(type: 'deleteLeft' | 'deleteRight', callback: (length: number) => void): void
on(type: 'deleteLeft', callback: (length: number) => void): void
订阅输入法应用向左删除或向右删除事件。使用callback异步回调。
订阅输入法应用向左删除事件。使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
......@@ -1704,8 +1704,8 @@ on(type: 'deleteLeft' | 'deleteRight', callback: (length: number) => void): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----- | ---- | ----- |
| type | string | 是 | 设置监听类型。<br/>- type为‘deleteLeft’时表示订阅输入法应用向左删除事件监听。 <br/>- type为‘deleteRight’时表示订阅输入法应用向右删除事件监听。|
| callback | (length: number) => void | 是 | 回调函数,返回需要向左或向右删除的文本的长度。<br/>开发者需要在回调函数中根据传入的删除长度操作编辑框中相应文本。 |
| type | string | 是 | 设置监听类型。<br/>- type为`deleteLeft`表示订阅输入法应用向左删除事件监听。 |
| callback | (length: number) => void | 是 | 回调函数,返回需要向左删除的文本的长度。<br/>开发者需要在回调函数中根据传入的删除长度操作编辑框中相应文本。 |
**错误码:**
......@@ -1725,7 +1725,34 @@ try {
} catch(err) {
console.error(`Failed to subscribe deleteLeft: ${JSON.stringify(err)}`);
}
```
### on('deleteRight')<sup>10+</sup>
on(type: 'deleteRight', callback: (length: number) => void): void
订阅输入法应用向右删除事件。使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----- | ---- | ----- |
| type | string | 是 | 设置监听类型。<br/>- type为`deleteRight`表示订阅输入法应用向右删除事件监听。|
| callback | (length: number) => void | 是 | 回调函数,返回需要向右删除的文本的长度。<br/>开发者需要在回调函数中根据传入的删除长度操作编辑框中相应文本。 |
**错误码:**
以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)
| 错误码ID | 错误信息 |
| -------- | -------------------------------------- |
| 12800009 | input method client is detached. |
**示例:**
```js
try {
inputMethodController.on('deleteRight', (length) => {
console.log(`Succeeded in subscribing deleteRight, length: ${length}`);
......@@ -1734,12 +1761,11 @@ try {
console.error(`Failed to subscribe deleteRight: ${JSON.stringify(err)}`);
}
```
### off('deleteLeft')<sup>10+</sup>
### off('deleteLeft' | 'deleteRight')<sup>10+</sup>
off(type: 'deleteLeft'): void
off(type: 'deleteLeft' | 'deleteRight'): void
取消订阅输入法应用向左或向右删除文本事件。
取消订阅输入法应用向左删除文本事件。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
......@@ -1747,12 +1773,31 @@ off(type: 'deleteLeft' | 'deleteRight'): void
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 设置监听类型。<br/>- type为‘deleteLeft’时表示取消订阅输入法应用向左删除的事件监听。 <br/>- type为‘deleteRight’时表示取消订阅输入法应用向右删除的事件监听。|
| type | string | 是 | 设置监听类型。<br/>- type为`deleteLeft`表示取消订阅输入法应用向左删除的事件监听。|
**示例:**
```js
inputMethodController.off('deleteLeft');
```
### off('deleteRight')<sup>10+</sup>
off(type: 'deleteRight'): void
取消订阅输入法应用向右删除文本事件。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 设置监听类型。<br/>- type为`deleteRight`表示取消订阅输入法应用向右删除的事件监听。|
**示例:**
```js
inputMethodController.off('deleteRight');
```
......@@ -2110,11 +2155,11 @@ off(type: 'imeChange', callback?: (inputMethodProperty: InputMethodProperty, inp
inputMethodSetting.off('imeChange');
```
### on('imeShow'|'imeHide')<sup>10+</sup>
### on('imeShow')<sup>10+</sup>
on(type: 'imeShow'|'imeHide', callback: (info: Array\<InputWindowInfo>) => void): void
on(type: 'imeShow', callback: (info: Array\<InputWindowInfo>) => void): void
订阅输入法软键盘显示或隐藏事件。使用callback异步回调。
订阅输入法软键盘显示事件。使用callback异步回调。
**系统接口**:此接口为系统接口。
......@@ -2124,7 +2169,7 @@ on(type: 'imeShow'|'imeHide', callback: (info: Array\<InputWindowInfo>) => void)
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---- | ---- | ---- |
| type | string | 是 | 设置监听类型。<br/>- type为`imeShow`时表示订阅输入法软键盘显示事件。<br/>- type为`imeHide`时表示订阅输入法软键盘隐藏事件。 |
| type | string | 是 | 设置监听类型。<br/>- type为`imeShow`表示订阅输入法软键盘显示事件。 |
| callback | (info: Array\<InputWindowInfo>) => void | 是 | 回调函数,返回输入法软键盘信息。 |
**示例:**
......@@ -2135,11 +2180,36 @@ inputMethodSetting.on('imeShow', (info) => {
});
```
### off('imeShow'|'imeHide')<sup>10+</sup>
### on('imeHide')<sup>10+</sup>
off(type: 'imeShow'|'imeHide', callback?: (info: Array\<InputWindowInfo>) => void): void
on(type: 'imeHide', callback: (info: Array\<InputWindowInfo>) => void): void
取消订阅输入法软键盘显示或隐藏事件。
订阅输入法软键盘隐藏事件。使用callback异步回调。
**系统接口**:此接口为系统接口。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---- | ---- | ---- |
| type | string | 是 | 设置监听类型。<br/>- type为`imeHide`表示订阅输入法软键盘隐藏事件。 |
| callback | (info: Array\<InputWindowInfo>) => void | 是 | 回调函数,返回输入法软键盘信息。 |
**示例:**
```js
inputMethodSetting.on('imeHide', (info) => {
console.info('Succeeded in subscribing imeHide event.');
});
```
### off('imeShow')<sup>10+</sup>
off(type: 'imeShow', callback?: (info: Array\<InputWindowInfo>) => void): void
取消订阅输入法软键盘显示事件。
**系统接口**:此接口为系统接口。
......@@ -2149,7 +2219,7 @@ off(type: 'imeShow'|'imeHide', callback?: (info: Array\<InputWindowInfo>) => voi
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---- | ---- | ------ |
| type | string | 是 | 设置监听类型。<br/>- type为`imeShow`时表示取消订阅输入法软键盘显示事件。<br/>- type为`imeHide`时表示取消订阅输入法软键盘隐藏事件。 |
| type | string | 是 | 设置监听类型。<br/>- type为`imeShow`表示取消订阅输入法软键盘显示事件。 |
| callback | (info: Array\<InputWindowInfo>) => void | 否 | 取消订阅的回调函数。当该参数不填写时,取消订阅type对应的所有回调事件。 |
**示例:**
......@@ -2158,6 +2228,29 @@ off(type: 'imeShow'|'imeHide', callback?: (info: Array\<InputWindowInfo>) => voi
inputMethodSetting.off('imeShow');
```
### off('imeHide')<sup>10+</sup>
off(type: 'imeHide', callback?: (info: Array\<InputWindowInfo>) => void): void
取消订阅输入法软键盘隐藏事件。
**系统接口**:此接口为系统接口。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---- | ---- | ------ |
| type | string | 是 | 设置监听类型。<br/>- type为`imeHide`表示取消订阅输入法软键盘隐藏事件。 |
| callback | (info: Array\<InputWindowInfo>) => void | 否 | 取消订阅的回调函数。当该参数不填写时,取消订阅type对应的所有回调事件。 |
**示例:**
```js
inputMethodSetting.off('imeHide');
```
### listInputMethodSubtype<sup>9+</sup>
listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback&lt;Array&lt;InputMethodSubtype&gt;&gt;): void
......
......@@ -1258,11 +1258,11 @@ promise.then(() => {
});
```
### on<sup>10+</sup>
### on('show')<sup>10+</sup>
on(type: 'show' | 'hide', callback: () => void): void
on(type: 'show', callback: () => void): void
监听当前面板状态,使用callback异步回调。
监听当前面板显示状态,使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
......@@ -1270,7 +1270,7 @@ on(type: 'show' | 'hide', callback: () => void): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | -------- |
| type | 'show'\|'hide' | 是 | 监听当前面板的状态类型,show表示显示状态,hide表示隐藏状态 |
| type | string | 是 | 监听当前面板的状态类型。 <br/>- type为`show`表示显示状态。 |
| callback | () => void | 是 | 回调函数。 |
**示例:**
......@@ -1281,11 +1281,11 @@ panel.on('show', () => {
});
```
### off<sup>10+</sup>
### on('hide')<sup>10+</sup>
off(type: 'show' | 'hide', callback?: () => void): void
on(type: 'hide', callback: () => void): void
取消监听当前面板状态,使用callback异步回调。
监听当前面板隐藏状态,使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
......@@ -1293,7 +1293,30 @@ off(type: 'show' | 'hide', callback?: () => void): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | -------- |
| type | 'show'\|'hide' | 是 | 要取消监听的当前面板状态类型,show表示显示状态,hide表示隐藏状态 |
| type | string | 是 | 监听当前面板的状态类型。 <br/>- type为`hide`表示隐藏状态。 |
| callback | () => void | 是 | 回调函数。 |
**示例:**
```js
panel.on('hide', () => {
console.log('Panel is hiding.');
});
```
### off('show')<sup>10+</sup>
off(type: 'show', callback?: () => void): void
取消监听当前面板显示状态,使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | -------- |
| type | string | 是 | 要取消监听的当前面板状态类型。 <br/>- type为`show`表示显示状态。 |
| callback | () => void | 否 | 回调函数。 |
**示例:**
......@@ -1302,6 +1325,27 @@ off(type: 'show' | 'hide', callback?: () => void): void
panel.off('show');
```
### off('hide')<sup>10+</sup>
off(type: 'hide', callback?: () => void): void
取消监听当前面板隐藏状态,使用callback异步回调。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | -------- |
| type | string | 是 | 要取消监听的当前面板状态类型。 <br/>- type为`hide`表示隐藏状态。 |
| callback | () => void | 否 | 回调函数。 |
**示例:**
```js
panel.off('hide');
```
### changeFlag<sup>10+</sup>
changeFlag(flag: PanelFlag): void
......
......@@ -1888,11 +1888,11 @@ resume(callback: AsyncCallback&lt;void&gt;): void
| conf | [Conf](#conf10) | 是 | 任务的配置信息。 |
### on('progress'|'completed'|'failed')<sup>10+</sup>
### on('progress')<sup>10+</sup>
on(event: "progress" | "completed" | "failed", callback: (progress: Progress) =&gt; void): void
on(event: 'progress', callback: (progress: Progress) =&gt; void): void
订阅任务相关的监听。
订阅任务进度的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
......@@ -1900,8 +1900,8 @@ on(event: "progress" | "completed" | "failed", callback: (progress: Progress) =&
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'progress',表示任务进度<br/>- 取值为'completed',表示任务已完成;<br/>- 取值为'failed',表示任务失败。 |
| callback | function | 是 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构|
| event | string | 是 | 订阅的事件类型。<br>- 取值为'progress',表示任务进度。 |
| callback | function | 是 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构|
**错误码:**
......@@ -1950,7 +1950,149 @@ on(event: "progress" | "completed" | "failed", callback: (progress: Progress) =&
};
request.agent.create(context, conf).then((task)=> {
task.on('progress', createOnCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
console.error(`Failed to create a upload task, Code: ${err.code}, message: ${err.message}`);
});
```
> **说明:**
>
> 示例中context的获取方式请参见[获取UIAbility的上下文信息](../../application-models/uiability-usage.md#获取uiability的上下文信息)。
### on('completed')<sup>10+</sup>
on(event: 'completed', callback: (progress: Progress) =&gt; void): void
订阅任务完成的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'completed',表示任务完成。 |
| callback | function | 是 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构。 |
**错误码:**
以下错误码的详细介绍请参见[上传下载错误码](../errorcodes/errorcode-request.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 21900005 | task mode error. |
**示例:**
```js
let context;
let attachments = [{
name: "taskOnTest",
value: {
filename: "taskOnTest.avi",
mimetype: "application/octet-stream",
path: "./taskOnTest.avi",
}
}];
let conf = {
action: request.agent.Action.UPLOAD,
url: 'http://127.0.0.1',
title: 'taskOnTest',
description: 'Sample code for event listening',
mode: request.agent.Mode.BACKGROUND,
overwrite: false,
method: "PUT",
data: attachments,
saveas: "./",
network: request.agent.Network.CELLULAR,
metered: false,
roaming: true,
retry: true,
redirect: true,
index: 0,
begins: 0,
ends: -1,
gauge: false,
precise: false,
token: "it is a secret"
};
let createOnCallback = (progress) => {
console.info('upload task completed.');
};
request.agent.create(context, conf).then((task)=> {
task.on('completed', createOnCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
console.error(`Failed to create a upload task, Code: ${err.code}, message: ${err.message}`);
});
```
> **说明:**
>
> 示例中context的获取方式请参见[获取UIAbility的上下文信息](../../application-models/uiability-usage.md#获取uiability的上下文信息)。
### on('failed')<sup>10+</sup>
on(event: 'failed', callback: (progress: Progress) =&gt; void): void
订阅任务失败的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'failed',表示任务失败。 |
| callback | function | 是 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构。 |
**错误码:**
以下错误码的详细介绍请参见[上传下载错误码](../errorcodes/errorcode-request.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 21900005 | task mode error. |
**示例:**
```js
let context;
let attachments = [{
name: "taskOnTest",
value: {
filename: "taskOnTest.avi",
mimetype: "application/octet-stream",
path: "./taskOnTest.avi",
}
}];
let conf = {
action: request.agent.Action.UPLOAD,
url: 'http://127.0.0.1',
title: 'taskOnTest',
description: 'Sample code for event listening',
mode: request.agent.Mode.BACKGROUND,
overwrite: false,
method: "PUT",
data: attachments,
saveas: "./",
network: request.agent.Network.CELLULAR,
metered: false,
roaming: true,
retry: true,
redirect: true,
index: 0,
begins: 0,
ends: -1,
gauge: false,
precise: false,
token: "it is a secret"
};
let createOnCallback = (progress) => {
console.info('upload task completed.');
};
request.agent.create(context, conf).then((task)=> {
task.on('failed', createOnCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
......@@ -1962,11 +2104,12 @@ on(event: "progress" | "completed" | "failed", callback: (progress: Progress) =&
>
> 示例中context的获取方式请参见[获取UIAbility的上下文信息](../../application-models/uiability-usage.md#获取uiability的上下文信息)。
### off('progress'|'completed'|'failed')<sup>10+</sup>
off(event: "progress" | "completed" | "failed", callback?: (progress: Progress) =&gt; void): void
### off('progress')<sup>10+</sup>
off(event: 'progress', callback?: (progress: Progress) =&gt; void): void
取消订阅任务相关的监听。
取消订阅任务进度的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
......@@ -1974,8 +2117,8 @@ off(event: "progress" | "completed" | "failed", callback?: (progress: Progress)
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'progress',表示任务进度<br/>- 取值为'completed',表示任务已完成;<br/>- 取值为'failed',表示任务失败。 |
| callback | function | 否 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构|
| event | string | 是 | 订阅的事件类型。<br>- 取值为'progress',表示任务进度。 |
| callback | function | 否 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构|
**错误码:**
......@@ -2024,10 +2167,152 @@ off(event: "progress" | "completed" | "failed", callback?: (progress: Progress)
};
request.agent.create(context, conf).then((task)=> {
task.on('progress', createOffCallback);
task.on('completed', createOffCallback);
task.on('failed', createOffCallback);
task.off('progress', createOffCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
console.error(`Failed to create a upload task, Code: ${err.code}, message: ${err.message}`);
});
```
> **说明:**
>
> 示例中context的获取方式请参见[获取UIAbility的上下文信息](../../application-models/uiability-usage.md#获取uiability的上下文信息)。
### off('completed')<sup>10+</sup>
off(event: 'completed', callback?: (progress: Progress) =&gt; void): void
取消订阅任务完成的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'completed',表示任务完成。 |
| callback | function | 否 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构。 |
**错误码:**
以下错误码的详细介绍请参见[上传下载错误码](../errorcodes/errorcode-request.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 21900005 | task mode error. |
**示例:**
```js
let context;
let attachments = [{
name: "taskOffTest",
value: {
filename: "taskOffTest.avi",
mimetype: "application/octet-stream",
path: "./taskOffTest.avi",
}
}];
let conf = {
action: request.agent.Action.UPLOAD,
url: 'http://127.0.0.1',
title: 'taskOffTest',
description: 'Sample code for event listening',
mode: request.agent.Mode.BACKGROUND,
overwrite: false,
method: "PUT",
data: attachments,
saveas: "./",
network: request.agent.Network.CELLULAR,
metered: false,
roaming: true,
retry: true,
redirect: true,
index: 0,
begins: 0,
ends: -1,
gauge: false,
precise: false,
token: "it is a secret"
};
let createOffCallback = (progress) => {
console.info('upload task completed.');
};
request.agent.create(context, conf).then((task)=> {
task.on('completed', createOffCallback);
task.off('completed', createOffCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
console.error(`Failed to create a upload task, Code: ${err.code}, message: ${err.message}`);
});
```
> **说明:**
>
> 示例中context的获取方式请参见[获取UIAbility的上下文信息](../../application-models/uiability-usage.md#获取uiability的上下文信息)。
### off('failed')<sup>10+</sup>
off(event: 'failed', callback?: (progress: Progress) =&gt; void): void
取消订阅任务失败的监听。
**系统能力**: SystemCapability.Request.FileTransferAgent
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 订阅的事件类型。<br>- 取值为'failed',表示任务失败。 |
| callback | function | 否 | 发生相关的事件时触发该回调方法,返回任务进度的数据结构。 |
**错误码:**
以下错误码的详细介绍请参见[上传下载错误码](../errorcodes/errorcode-request.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 21900005 | task mode error. |
**示例:**
```js
let context;
let attachments = [{
name: "taskOffTest",
value: {
filename: "taskOffTest.avi",
mimetype: "application/octet-stream",
path: "./taskOffTest.avi",
}
}];
let conf = {
action: request.agent.Action.UPLOAD,
url: 'http://127.0.0.1',
title: 'taskOffTest',
description: 'Sample code for event listening',
mode: request.agent.Mode.BACKGROUND,
overwrite: false,
method: "PUT",
data: attachments,
saveas: "./",
network: request.agent.Network.CELLULAR,
metered: false,
roaming: true,
retry: true,
redirect: true,
index: 0,
begins: 0,
ends: -1,
gauge: false,
precise: false,
token: "it is a secret"
};
let createOffCallback = (progress) => {
console.info('upload task completed.');
};
request.agent.create(context, conf).then((task)=> {
task.on('failed', createOffCallback);
task.off('failed', createOffCallback);
console.info(`Succeeded in creating a upload task. result: ${task.tid}`);
}).catch((err) => {
......@@ -2053,7 +2338,7 @@ start(callback: AsyncCallback&lt;void&gt;): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | function | 是 | 回调函数,开启任务成功,err为undefined,否则为错误对象 |
| callback | function | 是 | 回调函数,开启任务成功,err为undefined,否则为错误对象 |
**错误码:**
......@@ -2187,7 +2472,7 @@ pause(callback: AsyncCallback&lt;void&gt;): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | function | 是 | 回调函数,暂停任务成功,err为undefined,否则为错误对象 |
| callback | function | 是 | 回调函数,暂停任务成功,err为undefined,否则为错误对象 |
**错误码:**
......@@ -2564,7 +2849,7 @@ stop(): Promise&lt;void&gt;
create(context: BaseContext, conf: Conf, callback: AsyncCallback&lt;Task&gt;): void
创建要上传或下载的任务,并将其排入队列,使用callback异步回调。
创建要上传或下载的任务,并将其排入队列,应用最多支持创建10个任务,服务承载的任务数最多为300个。使用callback异步回调。
**需要权限**:ohos.permission.INTERNET
......@@ -2641,7 +2926,7 @@ create(context: BaseContext, conf: Conf, callback: AsyncCallback&lt;Task&gt;): v
create(context: BaseContext, conf: Conf): Promise&lt;Task&gt;
创建要上传或下载的任务,并将其排入队列。使用Promise异步回调。
创建要上传或下载的任务,并将其排入队列,应用最多支持创建10个任务,服务承载的任务数最多为300个。使用Promise异步回调。
**需要权限**:ohos.permission.INTERNET
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册