diff --git a/api/@ohos.fileshare.d.ts b/api/@ohos.fileshare.d.ts index 2eed8dfe4473678478dcf8418d4ec86ee4ecdc9b..a7274fe4788b6378e13af412e7db653210ed3135 100644 --- a/api/@ohos.fileshare.d.ts +++ b/api/@ohos.fileshare.d.ts @@ -252,6 +252,12 @@ declare namespace fileShare { PERSISTENT_TYPE = 1, } + /** + * @since 20 + * @arkts 1.2 + */ + overload grantUriPermission { grantUriPermissionWithCallback, grantUriPermissionReturnsPromise }; + /** * Provides grant uri permission for app * @@ -267,8 +273,32 @@ declare namespace fileShare { * @throws { BusinessError } 14300001 - IPC error * @syscap SystemCapability.FileManagement.AppFileService * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function grantUriPermissionWithCallback( + uri: string, + bundleName: string, + flag: wantConstant.Flags, + callback: AsyncCallback + ): void; + + /** + * Provides grant uri permission for app + * + * @permission ohos.permission.WRITE_MEDIA + * @param { string } uri uri + * @param { string } bundleName bundleName + * @param { wantConstant.Flags } flag wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission verification failed + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 14300001 - IPC error + * @syscap SystemCapability.FileManagement.AppFileService + * @systemapi + * @since 9 */ function grantUriPermission( uri: string, @@ -292,8 +322,27 @@ declare namespace fileShare { * @throws { BusinessError } 14300001 - IPC error * @syscap SystemCapability.FileManagement.AppFileService * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function grantUriPermissionReturnsPromise(uri: string, bundleName: string, flag: wantConstant.Flags): Promise; + + /** + * Provides grant uri permission for app + * + * @permission ohos.permission.WRITE_MEDIA + * @param { string } uri uri + * @param { string } bundleName bundleName + * @param { wantConstant.Flags } flag wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION + * @returns { Promise } no callback return Promise otherwise return void + * @throws { BusinessError } 201 - Permission verification failed + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 14300001 - IPC error + * @syscap SystemCapability.FileManagement.AppFileService + * @systemapi + * @since 9 */ function grantUriPermission(uri: string, bundleName: string, flag: wantConstant.Flags): Promise;