From 3afc42fb1dc4cfc678bee035663c778733c49539 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Thu, 26 May 2022 20:54:11 +0800 Subject: [PATCH] Signed-off-by: lovechinamo Changes to be committed: --- api/@ohos.request.d.ts | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 38ddc06e5f..3935722821 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -13,6 +13,7 @@ * limitations under the License. */ import { AsyncCallback } from './basic'; +import Context from './application/Context'; /** * upload and download @@ -190,9 +191,22 @@ declare namespace request { * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET * @return - + * @FAModelOnly */ function download(config: DownloadConfig, callback: AsyncCallback): void; + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @param context Indicates the application context. + * @param config download config + * @param callback Indicate the callback function to receive DownloadTask. + * @permission ohos.permission.INTERNET + * @return - + */ + function download(context: Context, config: DownloadConfig, callback: AsyncCallback): void; + /** * Starts a download session. * @syscap SystemCapability.MiscServices.Download @@ -200,9 +214,21 @@ declare namespace request { * @param config download config * @permission ohos.permission.INTERNET * @return - + * @FAModelOnly */ function download(config: DownloadConfig): Promise; + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 9 + * @param context Indicates the application context. + * @param config download config + * @permission ohos.permission.INTERNET + * @return - + */ + function download(context: Context, config: DownloadConfig): Promise; + /** * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload @@ -211,9 +237,22 @@ declare namespace request { * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET * @return - + * @FAModelOnly */ function upload(config: UploadConfig, callback: AsyncCallback): void; + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 9 + * @param context Indicates the application context. + * @param config upload config + * @param callback Indicate the callback function to receive UploadTask. + * @permission ohos.permission.INTERNET + * @return - + */ + function upload(context: Context, config: UploadConfig, callback: AsyncCallback): void; + /** * Starts a upload session. * @syscap SystemCapability.MiscServices.Upload @@ -221,9 +260,21 @@ declare namespace request { * @param config upload config * @permission ohos.permission.INTERNET * @return - + * @FAModelOnly */ function upload(config: UploadConfig): Promise; + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 9 + * @param context Indicates the application context. + * @param config upload config + * @permission ohos.permission.INTERNET + * @return - + */ + function upload(context: Context, config: UploadConfig): Promise; + /** * DownloadConfig data Structure * -- Gitee