diff --git a/api/@ohos.application.BackupExtensionAbility.d.ts b/api/@ohos.application.BackupExtensionAbility.d.ts index a03b3095196ecc5863cf928d630896c9556a9af2..147010c2a5ca8b556eeddb4e945458e2e3b53391 100644 --- a/api/@ohos.application.BackupExtensionAbility.d.ts +++ b/api/@ohos.application.BackupExtensionAbility.d.ts @@ -168,6 +168,32 @@ declare class BackupExtensionAbility { * @since 20 */ onRelease(scenario: number): Promise; + + /** + * Callback to be called when getting application backup compatibilityInfo. + * Developer could override this method to provide the backup compatibilityInfo. + * + * @param { string } extInfo Information about the capabilities of the peer. + * @returns { Promise } Return backup compatibilityInfo, support promise. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 20 + */ + getBackupCompatibilityInfo(extInfo: string) : Promise; + + /** + * Callback to be called when getting application restore compatibilityInfo. + * Developer could override this method to provide the restore compatibilityInfo. + * + * @param { string } extInfo Information about the capabilities of the peer. + * @returns { Promise } Return restore compatibilityInfo, support promise. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 20 + */ + getRestoreCompatibilityInfo(extInfo: string) : Promise; } export default BackupExtensionAbility; diff --git a/api/@ohos.file.backup.d.ts b/api/@ohos.file.backup.d.ts index 723db6e50adf6b59397f842c5ae4b8f938dbe6a8..4310765c872cf78e6e4bd37d333a46abbc4f8910 100644 --- a/api/@ohos.file.backup.d.ts +++ b/api/@ohos.file.backup.d.ts @@ -677,6 +677,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } /** @@ -901,6 +916,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } /** @@ -1059,6 +1089,21 @@ declare namespace backup { * @since 20 */ cleanBundleTempDir(bundleName: string): Promise; + + /** + * Provides an interface for the tool to get compatibility info. + * @permission ohos.permission.BACKUP + * @param { string } bundleName - Set the bundleName of the application that need to get compatibilityInfo. + * @param { string } extInfo - Indicates the extension information of application. + * @returns { Promise } Return compatibility info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, + * application which is not a system application uses system API. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 20 + */ + getCompatibilityInfo(bundleName: string, extInfo: string): Promise; } } export default backup;