From 67e21bc1265ea0f5d6add3b704f83f3e632019fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miss=E6=B7=B1=E6=B5=B7=E9=B1=BC?= Date: Sat, 26 Mar 2022 02:00:05 +0000 Subject: [PATCH 1/2] update api/@ohos.request.d.ts. Signed-off-by: miss-deep-sea-fish --- api/@ohos.request.d.ts | 286 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 252 insertions(+), 34 deletions(-) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 5da8cea8e5..764b68eaa6 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -16,8 +16,6 @@ import { AsyncCallback } from './basic'; /** * upload and download - * @syscap SystemCapability.MiscServices.Download - * @since 7 * * @import request from '@ohos.request'; * @permission {@code ohos.permission.INTERNET} @@ -27,7 +25,7 @@ declare namespace request { /** * Bit flag indicating download is allowed when using the cellular network. * @syscap SystemCapability.MiscServices.Download - * @since 7 + * @since 6 * @permission {@code ohos.permission.INTERNET} */ const NETWORK_MOBILE: number; @@ -35,7 +33,7 @@ declare namespace request { /** * Bit flag indicating download is allowed when using the WLAN. * @syscap SystemCapability.MiscServices.Download - * @since 7 + * @since 6 * @permission {@code ohos.permission.INTERNET} */ const NETWORK_WIFI: number; @@ -226,29 +224,159 @@ declare namespace request { */ function upload(config: UploadConfig): Promise; + /** + * DownloadConfig data Structure + * + * @name DownloadConfig + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission {@code ohos.permission.INTERNET} + */ interface DownloadConfig { - url: string; // Resource address. - header?: Object; // Adds an HTTP or HTTPS header to be included with the download request. - enableMetered?: boolean; // Allows download under a metered connection. - enableRoaming?: boolean; // Allows download in a roaming network. - description?: string; // Sets the description of a download session. - networkType?: number; // Sets the network type allowed for download. - filePath?: string; // Sets the path for downloads. - title?: string; // Sets a download session title. + /** + * Resource address. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + url: string; + /** + * Adds an HTTP or HTTPS header to be included with the download request. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + header?: Object; + /** + * Allows download under a metered connection. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + enableMetered?: boolean; + /** + * Allows download in a roaming network. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + enableRoaming?: boolean; + /** + * Sets the description of a download session. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + description?: string; + /** + * Sets the network type allowed for download. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + networkType?: number; + /** + * Sets the path for downloads. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + filePath?: string; + /** + * Sets a download session title. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + title?: string; } + /** + * DownloadInfo data Structure + * + * @name DownloadInfo + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ interface DownloadInfo { - description: string; // the description of a file to be downloaded. - downloadedBytes: number; // the real-time downloads size (in bytes). - downloadId: number; // the ID of a file to be downloaded. - failedReason: number; // a download failure cause, which can be any DownloadSession.ERROR_* constant. - fileName: string; // the name of a file to be downloaded. - filePath: string; // the URI of a stored file. - pausedReason: number; // the reason why a session is paused, which can be any DownloadSession.PAUSED_* constant. - status: number; // the download status code, which can be any DownloadSession.SESSION_* constant. - targetURI: string; // the URI of files to be downloaded. - downloadTitle: string; // the title of a file to be downloaded. - downloadTotalBytes: number; // the total size of files to be downloaded (in bytes). + /** + * the description of a file to be downloaded. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + description: string; + /** + * the real-time downloads size (in bytes). + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + downloadedBytes: number; + /** + * the ID of a file to be downloaded. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + downloadId: number; + /** + * a download failure cause, which can be any DownloadSession.ERROR_* constant. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + failedReason: number; + /** + * the name of a file to be downloaded. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + fileName: string; + /** + * the URI of a stored file. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + filePath: string; + /** + * the reason why a session is paused, which can be any DownloadSession.PAUSED_* constant. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + pausedReason: number; + /** + * the download status code, which can be any DownloadSession.SESSION_* constant. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + status: number; + /** + * the URI of files to be downloaded. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + targetURI: string; + /** + * the title of a file to be downloaded. + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + downloadTitle: string; + /** + * the total size of files to be downloaded (in bytes). + * + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + downloadTotalBytes: number; } interface DownloadTask { @@ -426,24 +554,114 @@ declare namespace request { queryMimeType(): Promise; } + /** + * File data Structure + * + * @name File + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission {@code ohos.permission.INTERNET} + */ interface File { - filename: string; // When multipart is submitted, the file name in the request header. - name: string; // When multipart is submitted, the name of the form item. The default is file. - uri: string; // The local storage path of the file (please refer to the storage directory definition for path usage). - type: string; // The content type of the file is obtained by default according to the suffix of the file name or path. + /** + * When multipart is submitted, the file name in the request header. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + filename: string; + /** + * When multipart is submitted, the name of the form item. The default is file. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + name: string; + /** + * The local storage path of the file (please refer to the storage directory definition for path usage). + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + uri: string; + /** + * The content type of the file is obtained by default according to the suffix of the file name or path. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + type: string; } + /** + * RequestData data Structure + * + * @name RequestData + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission {@code ohos.permission.INTERNET} + */ interface RequestData { - name: string; // Represents the name of the form element. - value: string; // Represents the value of the form element. + /** + * Represents the name of the form element. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + name: string; + /** + * Represents the value of the form element. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + value: string; } + /** + * UploadConfig data Structure + * + * @name UploadConfig + * @since 6 + * @syscap SystemCapability.MiscServices.Upload + * @permission {@code ohos.permission.INTERNET} + */ interface UploadConfig { - url: string; // Resource address. - header: Object; // Adds an HTTP or HTTPS header to be included with the upload request. - method: string; // Request method: POST, PUT. The default POST. - files: Array; // A list of files to be uploaded. Please use multipart/form-data to submit. - data: Array; // The requested form data. + /** + * Resource address. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + url: string; + /** + * Adds an HTTP or HTTPS header to be included with the upload request. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + header: Object; + /** + * Request method: POST, PUT. The default POST. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + method: string; + /** + * A list of files to be uploaded. Please use multipart/form-data to submit. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + files: Array; + /** + * The requested form data. + * + * @since 6 + * @permission {@code ohos.permission.INTERNET} + */ + data: Array; } interface UploadTask { -- Gitee From f182678b43958a949886a861daa0ef4fd44b1e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miss=E6=B7=B1=E6=B5=B7=E9=B1=BC?= Date: Sat, 26 Mar 2022 08:33:49 +0000 Subject: [PATCH 2/2] update api/@ohos.request.d.ts. Signed-off-by: miss-deep-sea-fish --- api/@ohos.request.d.ts | 167 +++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 764b68eaa6..38ddc06e5f 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -18,7 +18,7 @@ import { AsyncCallback } from './basic'; * upload and download * * @import request from '@ohos.request'; - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ declare namespace request { @@ -26,7 +26,7 @@ declare namespace request { * Bit flag indicating download is allowed when using the cellular network. * @syscap SystemCapability.MiscServices.Download * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const NETWORK_MOBILE: number; @@ -34,7 +34,7 @@ declare namespace request { * Bit flag indicating download is allowed when using the WLAN. * @syscap SystemCapability.MiscServices.Download * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const NETWORK_WIFI: number; @@ -42,7 +42,7 @@ declare namespace request { * Indicates that the download cannot be resumed for some temporary errors. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_CANNOT_RESUME: number; @@ -50,7 +50,7 @@ declare namespace request { * Indicates that no storage device, such as an SD card, is found. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_DEVICE_NOT_FOUND: number; @@ -58,7 +58,7 @@ declare namespace request { * Indicates that files to be downloaded already exist, and that the download session cannot overwrite the existing files. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_FILE_ALREADY_EXISTS: number; @@ -66,7 +66,7 @@ declare namespace request { * Indicates that a file operation fails. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_FILE_ERROR: number; @@ -74,7 +74,7 @@ declare namespace request { * Indicates that the HTTP transmission fails. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_HTTP_DATA_ERROR: number; @@ -82,7 +82,7 @@ declare namespace request { * Indicates insufficient storage space. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_INSUFFICIENT_SPACE: number; @@ -90,7 +90,7 @@ declare namespace request { * Indicates an error caused by too many network redirections. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_TOO_MANY_REDIRECTS: number; @@ -98,7 +98,7 @@ declare namespace request { * Indicates an HTTP code that cannot be identified. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_UNHANDLED_HTTP_CODE: number; @@ -106,7 +106,7 @@ declare namespace request { * Indicates an undefined error. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const ERROR_UNKNOWN: number; @@ -114,7 +114,7 @@ declare namespace request { * Indicates that the download is paused and waiting for a WLAN connection, because the file size exceeds the maximum allowed for a session using the cellular network. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const PAUSED_QUEUED_FOR_WIFI: number; @@ -122,7 +122,7 @@ declare namespace request { * Indicates that the download is paused for some reasons. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const PAUSED_UNKNOWN: number; @@ -130,7 +130,7 @@ declare namespace request { * Indicates that the download is paused due to a network problem, for example, network disconnection. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const PAUSED_WAITING_FOR_NETWORK: number; @@ -138,7 +138,7 @@ declare namespace request { * Indicates that a network error occurs, and the download session will be retried. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const PAUSED_WAITING_TO_RETRY: number; @@ -146,7 +146,7 @@ declare namespace request { * Indicates that the download session has failed and will not be retried. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const SESSION_FAILED: number; @@ -154,7 +154,7 @@ declare namespace request { * Indicates that the download session has been paused. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const SESSION_PAUSED: number; @@ -162,7 +162,7 @@ declare namespace request { * Indicates that the download session is being scheduled. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const SESSION_PENDING: number; @@ -170,7 +170,7 @@ declare namespace request { * Indicates that the download session is in progress. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const SESSION_RUNNING: number; @@ -178,7 +178,7 @@ declare namespace request { * Indicates that the download session is completed. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ const SESSION_SUCCESSFUL: number; @@ -188,7 +188,7 @@ declare namespace request { * @since 6 * @param config download config * @param callback Indicate the callback function to receive DownloadTask. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ function download(config: DownloadConfig, callback: AsyncCallback): void; @@ -198,7 +198,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 6 * @param config download config - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ function download(config: DownloadConfig): Promise; @@ -209,7 +209,7 @@ declare namespace request { * @since 6 * @param config upload config * @param callback Indicate the callback function to receive UploadTask. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ function upload(config: UploadConfig, callback: AsyncCallback): void; @@ -219,7 +219,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Upload * @since 6 * @param config upload config - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ function upload(config: UploadConfig): Promise; @@ -230,63 +230,63 @@ declare namespace request { * @name DownloadConfig * @since 6 * @syscap SystemCapability.MiscServices.Download - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ interface DownloadConfig { /** * Resource address. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ url: string; /** * Adds an HTTP or HTTPS header to be included with the download request. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ header?: Object; /** * Allows download under a metered connection. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ enableMetered?: boolean; /** * Allows download in a roaming network. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ enableRoaming?: boolean; /** * Sets the description of a download session. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ description?: string; /** * Sets the network type allowed for download. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ networkType?: number; /** * Sets the path for downloads. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ filePath?: string; /** * Sets a download session title. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ title?: string; } @@ -297,84 +297,84 @@ declare namespace request { * @name DownloadInfo * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ interface DownloadInfo { /** * the description of a file to be downloaded. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ description: string; /** * the real-time downloads size (in bytes). * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ downloadedBytes: number; /** * the ID of a file to be downloaded. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ downloadId: number; /** * a download failure cause, which can be any DownloadSession.ERROR_* constant. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ failedReason: number; /** * the name of a file to be downloaded. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ fileName: string; /** * the URI of a stored file. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ filePath: string; /** * the reason why a session is paused, which can be any DownloadSession.PAUSED_* constant. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ pausedReason: number; /** * the download status code, which can be any DownloadSession.SESSION_* constant. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ status: number; /** * the URI of files to be downloaded. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ targetURI: string; /** * the title of a file to be downloaded. * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ downloadTitle: string; /** * the total size of files to be downloaded (in bytes). * * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ downloadTotalBytes: number; } @@ -388,7 +388,7 @@ declare namespace request { * @param callback The callback function for the download progress change event * receivedSize the length of downloaded data, in bytes * totalSize he length of data expected to be downloaded, in bytes. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ on(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void; @@ -401,7 +401,7 @@ declare namespace request { * @param callback The callback function for the download progress change event * receivedSize the length of downloaded data, in bytes * totalSize he length of data expected to be downloaded, in bytes. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void; @@ -415,7 +415,7 @@ declare namespace request { * pause: download task stopped, * remove: download task deleted. * @param callback The callback function for the download complete、pause or remove change event. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ on(type: 'complete' | 'pause' | 'remove', callback: () => void): void; @@ -429,7 +429,7 @@ declare namespace request { * pause: download task stopped, * remove: download task deleted. * @param callback The callback function for the download complete、pause or remove change event. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ off(type: 'complete' | 'pause' | 'remove', callback?: () => void): void; @@ -441,7 +441,7 @@ declare namespace request { * @param type Indicates the download session type, fail: download task has failed. * @param callback The callback function for the download fail change event * err The error code for download task. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ on(type: 'fail', callback: (err: number) => void): void; @@ -453,7 +453,7 @@ declare namespace request { * @param type Indicates the download session type, fail: download task has failed. * @param callback Indicate the callback function to receive err. * err The error code for download task. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ off(type: 'fail', callback?: (err: number) => void): void; @@ -463,7 +463,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 6 * @param callback Indicates asynchronous invoking Result. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ remove(callback: AsyncCallback): void; @@ -472,7 +472,7 @@ declare namespace request { * Deletes a download session and the downloaded files. * @syscap SystemCapability.MiscServices.Download * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ remove(): Promise; @@ -482,7 +482,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 7 * @param callback Indicates asynchronous invoking Result. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ pause(callback: AsyncCallback): void; @@ -491,7 +491,7 @@ declare namespace request { * Pause a download session. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ pause(): Promise; @@ -501,7 +501,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 7 * @param callback Indicates asynchronous invoking Result. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ resume(callback: AsyncCallback): void; @@ -510,7 +510,7 @@ declare namespace request { * Resume a paused download session. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ resume(): Promise; @@ -520,7 +520,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 7 * @param callback Indicate the callback function to receive download info. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ query(callback: AsyncCallback): void; @@ -529,7 +529,7 @@ declare namespace request { * Queries download information of a session, which is defined in DownloadSession.DownloadInfo. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ query(): Promise; @@ -539,7 +539,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download * @since 7 * @param callback Indicate the callback function to receive download file MIME type. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ queryMimeType(callback: AsyncCallback): void; @@ -548,7 +548,7 @@ declare namespace request { * Queries the MIME type of the download file. * @syscap SystemCapability.MiscServices.Download * @since 7 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ queryMimeType(): Promise; @@ -560,35 +560,35 @@ declare namespace request { * @name File * @since 6 * @syscap SystemCapability.MiscServices.Download - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ interface File { /** * When multipart is submitted, the file name in the request header. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ filename: string; /** * When multipart is submitted, the name of the form item. The default is file. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ name: string; /** * The local storage path of the file (please refer to the storage directory definition for path usage). * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ uri: string; /** * The content type of the file is obtained by default according to the suffix of the file name or path. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ type: string; } @@ -599,21 +599,21 @@ declare namespace request { * @name RequestData * @since 6 * @syscap SystemCapability.MiscServices.Download - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ interface RequestData { /** * Represents the name of the form element. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ name: string; /** * Represents the value of the form element. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ value: string; } @@ -624,42 +624,42 @@ declare namespace request { * @name UploadConfig * @since 6 * @syscap SystemCapability.MiscServices.Upload - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ interface UploadConfig { /** * Resource address. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ url: string; /** * Adds an HTTP or HTTPS header to be included with the upload request. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ header: Object; /** * Request method: POST, PUT. The default POST. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ method: string; /** * A list of files to be uploaded. Please use multipart/form-data to submit. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ files: Array; /** * The requested form data. * * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET */ data: Array; } @@ -673,7 +673,7 @@ declare namespace request { * @param callback The callback function for the upload progress change event * uploadedSize The length of uploaded data, in bytes * totalSize The length of data expected to be uploaded, in bytes. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void; @@ -686,7 +686,7 @@ declare namespace request { * @param callback The callback function for the upload progress change event * uploadedSize The length of uploaded data, in bytes * totalSize The length of data expected to be uploaded, in bytes. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void; @@ -698,7 +698,7 @@ declare namespace request { * @param type headerReceive Indicates the upload task headed receive. * @param callback The callback function for the HTTP Response Header event * header HTTP Response Header returned by the developer server. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ on(type: 'headerReceive', callback: (header: object) => void): void; @@ -710,7 +710,7 @@ declare namespace request { * @param type headerReceive Indicates the upload task headed receive. * @param callback The callback function for the HTTP Response Header event * header HTTP Response Header returned by the developer server. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ off(type: 'headerReceive', callback?: (header: object) => void): void; @@ -720,7 +720,7 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Upload * @since 6 * @param callback Indicates asynchronous invoking Result. - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ remove(callback: AsyncCallback): void; @@ -729,11 +729,12 @@ declare namespace request { * Deletes a upload session. * @syscap SystemCapability.MiscServices.Upload * @since 6 - * @permission {@code ohos.permission.INTERNET} + * @permission ohos.permission.INTERNET * @return - */ remove(): Promise; } } -export default request; \ No newline at end of file +export default request; + -- Gitee