diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 38ddc06e5f6f586caea9ec4d8814223feeac62c6..39357228211dbcd4b2e17cc750cc60e108f5b131 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 *