文件最后提交记录最后更新时间
docs: add OHOS API documentation (1290 APIs, 66 modules) Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
docs: remove platform support section from API docs Signed-off-by: zhangqingnan_codeing <zhangqingnan6@huawei.com> 1 个月前
README.md

DownloadItem API 列表

本模块包含 27 个 API。

Events(事件)

API 说明 鸿蒙支持
updated 在下载更新且未完成时触发。 支持
done 在下载进入终止状态时触发,包括下载完成、通过 downloadItem.cancel() 取消或无法恢复的中断下载。 支持

Methods(方法)

API 说明 鸿蒙支持
downloadItem.setSavePath(path) 设置下载项的保存路径,仅可在 session 的 will-download 回调中使用,若路径不存在 Electron 会递归创建目录。 支持
downloadItem.getSavePath() 返回 string,即下载项的保存路径。 支持
downloadItem.setSaveDialogOptions(options) 设置另存为对话框选项,参数与 dialog.showSaveDialog() 的 options 参数相同。 支持
downloadItem.getSaveDialogOptions() 返回 SaveDialogOptions,即之前通过 downloadItem.setSaveDialogOptions(options) 设置的对象。 支持
downloadItem.pause() 暂停下载。 支持
downloadItem.isPaused() 返回 boolean,表示下载是否已暂停。 支持
downloadItem.resume() 恢复已暂停的下载。 支持
downloadItem.canResume() 返回 boolean,表示下载是否可以恢复。 支持
downloadItem.cancel() 取消下载操作。 支持
downloadItem.getURL() 返回 string,即该下载项的来源 URL。 支持
downloadItem.getMimeType() 返回 string,即文件的 MIME 类型。 支持
downloadItem.hasUserGesture() 返回 boolean,表示下载是否由用户手势触发。 支持
downloadItem.getFilename() 返回 string,即下载项的文件名。 支持
downloadItem.getCurrentBytesPerSecond() 返回 Integer,即当前下载速度(字节/秒)。 支持
downloadItem.getTotalBytes() 返回 Integer,即下载项的总字节数。 支持
downloadItem.getReceivedBytes() 返回 Integer,即下载项已接收的字节数。 支持
downloadItem.getPercentComplete() 返回 Integer,即下载完成的百分比。 支持
downloadItem.getContentDisposition() 返回 string,即响应中的 Content-Disposition 字段值。 支持
downloadItem.getState() 返回 string,即当前下载状态,可为 progressing、completed、cancelled 或 interrupted。 支持
downloadItem.getURLChain() 返回 string[],即包含所有重定向在内的完整 URL 链。 支持
downloadItem.getLastModifiedTime() 返回 string,即 Last-Modified 响应头的值。 支持
downloadItem.getETag() 返回 string,即 ETag 响应头的值。 支持
downloadItem.getStartTime() 返回 Double,即下载开始时相对于 UNIX 纪元的秒数。 支持
downloadItem.getEndTime() 返回 Double,即下载结束时相对于 UNIX 纪元的秒数。 支持

Properties(属性)

API 说明 鸿蒙支持
downloadItem.savePath 字符串属性,用于设置下载项的保存路径。 支持