diff --git a/api/@ohos.file.cloudSyncManager.d.ts b/api/@ohos.file.cloudSyncManager.d.ts
index 16db44010cbf80b57e54aa6a41dc0b6230971dc9..d2d41de3d181b6e918df270038fdf035d2e91088 100644
--- a/api/@ohos.file.cloudSyncManager.d.ts
+++ b/api/@ohos.file.cloudSyncManager.d.ts
@@ -42,8 +42,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean): Promise;
@@ -60,8 +59,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function changeAppCloudSwitch(
accountId: string,
@@ -70,6 +68,53 @@ declare namespace cloudSyncManager {
callback: AsyncCallback
): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload changeAppCloudSwitch { changeAppCloudSwitchReturnsPromise, changeAppCloudSwitchWithCallback };
+
+ /**
+ * Modify switch state of the application's cloud synchronization capability.
+ *
+ * @param { string } accountId - Current account id
+ * @param { string } bundleName - Name of bundle whose switchStatus is changing
+ * @param { boolean } status - New switch status
+ * @returns { Promise } - Return Promise
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function changeAppCloudSwitchReturnsPromise(accountId: string, bundleName: string, status: boolean): Promise;
+
+ /**
+ * Modify switch state of the application's cloud synchronization capability.
+ *
+ * @param { string } accountId - Current account id
+ * @param { string } bundleName - Name of bundle whose switchStatus is changing
+ * @param { boolean } status - New switch status
+ * @param { AsyncCallback } callback - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function changeAppCloudSwitchWithCallback(
+ accountId: string,
+ bundleName: string,
+ status: boolean,
+ callback: AsyncCallback
+ ): void;
+
/**
* Notify the change of data in cloud.
*
@@ -82,8 +127,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function notifyDataChange(accountId: string, bundleName: string): Promise;
@@ -99,11 +143,44 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function notifyDataChange(accountId: string, bundleName: string, callback: AsyncCallback): void;
+ /**
+ * Notify the change of data in cloud.
+ *
+ * @param { string } accountId - Current account id
+ * @param { string } bundleName - Name of bundle whose switchStatus is changing
+ * @returns { Promise } Return Promise
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function notifyDataChangeWithBundleNameReturnsPromise(accountId: string, bundleName: string): Promise;
+
+ /**
+ * Notify the change of data in cloud.
+ *
+ * @param { string } accountId - Current account id
+ * @param { string } bundleName - Name of bundle whose switchStatus is changing
+ * @param { AsyncCallback } [callback] - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function notifyDataChangeWithBundleNameCallback(accountId: string, bundleName: string, callback: AsyncCallback): void;
+
/**
* Enable the cloud file synchronization function.
*
@@ -117,8 +194,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function enableCloud(accountId: string, switches: Record): Promise;
@@ -135,11 +211,52 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function enableCloud(accountId: string, switches: Record, callback: AsyncCallback): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload enableCloud { enableCloudReturnsPromise, enableCloudWithCallback };
+
+ /**
+ * Enable the cloud file synchronization function.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id.
+ * @param { Record } switches - Indicates switches information of all applications.
+ * @returns { Promise } Return Promise
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function enableCloudReturnsPromise(accountId: string, switches: Record): Promise;
+
+ /**
+ * Enable the cloud file synchronization function.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id
+ * @param { Record } switches - Indicates switches information of all applications.
+ * @param { AsyncCallback } callback - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function enableCloudWithCallback(accountId: string, switches: Record, callback: AsyncCallback): void;
+
/**
* Disable the cloud file synchronization function.
*
@@ -152,8 +269,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function disableCloud(accountId: string): Promise;
@@ -169,11 +285,50 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function disableCloud(accountId: string, callback: AsyncCallback): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload disableCloud { disableCloudReturnsPromise, disableCloudWithCallback };
+
+ /**
+ * Disable the cloud file synchronization function.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id.
+ * @returns { Promise } Return Promise.
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function disableCloudReturnsPromise(accountId: string): Promise;
+
+ /**
+ * Disable the cloud file synchronization function.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id.
+ * @param { AsyncCallback } callback - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function disableCloudWithCallback(accountId: string, callback: AsyncCallback): void;
+
/**
* Describes the clear action type.
*
@@ -218,8 +373,7 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function clean(accountId: string, appActions: Record): Promise;
@@ -236,11 +390,52 @@ declare namespace cloudSyncManager {
*
2.Incorrect parameter types.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'10','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 10
*/
function clean(accountId: string, appActions: Record, callback: AsyncCallback): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload clean { cleanReturnsPromise, cleanWithCallback };
+
+ /**
+ * Clean up cloud-related file data based on specific action.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id.
+ * @param { Record } appActions - Indicates information about cloud file need to clear in which way.
+ * @returns { Promise } Return Promise.
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function cleanReturnsPromise(accountId: string, appActions: Record): Promise;
+
+ /**
+ * Clean up cloud-related file data based on specific action.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { string } accountId - Current account id.
+ * @param { Record } appActions - Indicates information about cloud file need to clear in which way.
+ * @param { AsyncCallback } callback - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function cleanWithCallback(accountId: string, appActions: Record, callback: AsyncCallback): void;
+
/**
* Notify the change of data in cloud.
*
@@ -255,8 +450,7 @@ declare namespace cloudSyncManager {
* @throws { BusinessError } 13600001 - IPC error.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'11','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 11
*/
function notifyDataChange(userId: int, extraData: ExtraData): Promise;
@@ -274,11 +468,55 @@ declare namespace cloudSyncManager {
* @throws { BusinessError } 13600001 - IPC error.
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
* @systemapi
- * @since arkts{ '1.1':'11','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 11
*/
function notifyDataChange(userId: int, extraData: ExtraData, callback: AsyncCallback): void;
+ /**
+ * Notify the change of data in cloud.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { int } userId - The Id of the user whose cloud data changed
+ * @param { ExtraData } extraData - The change info from push notification
+ * @returns { Promise } Return Promise
+ * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @throws { BusinessError } 13600001 - IPC error.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function notifyDataChangeWithExtraDataReturnsPromise(userId: int, extraData: ExtraData): Promise;
+
+ /**
+ * Notify the change of data in cloud.
+ *
+ * @permission ohos.permission.CLOUDFILE_SYNC_MANAGER
+ * @param { int } userId - The Id of the user whose cloud data changed
+ * @param { ExtraData } extraData - The change info from push notification
+ * @param { AsyncCallback } callback - Callback function
+ * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
+ * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
+ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
+ *
2.Incorrect parameter types; 3.Parameter verification failed.
+ * @throws { BusinessError } 13600001 - IPC error.
+ * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function notifyDataChangeWithExtraDataCallback(userId: int, extraData: ExtraData, callback: AsyncCallback): void;
+
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload notifyDataChange { notifyDataChangeWithBundleNameReturnsPromise, notifyDataChangeWithBundleNameCallback,
+ notifyDataChangeWithExtraDataReturnsPromise, notifyDataChangeWithExtraDataCallback };
+
/**
* The change info from push notification.
*
diff --git a/api/@ohos.file.environment.d.ts b/api/@ohos.file.environment.d.ts
index cb5c78b0fd6a47e2f5d2dedc6d893ae01600dffb..d8332b57351d5504bde5c5f8e841ce910e730c58 100644
--- a/api/@ohos.file.environment.d.ts
+++ b/api/@ohos.file.environment.d.ts
@@ -38,8 +38,7 @@ declare namespace Environment {
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.Environment
* @systemapi
- * @since arkts {'1.1':'8','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 8
*/
function getStorageDataDir(): Promise;
@@ -52,11 +51,44 @@ declare namespace Environment {
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.Environment
* @systemapi
- * @since arkts {'1.1':'8','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 8
*/
function getStorageDataDir(callback: AsyncCallback): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload getStorageDataDir { getStorageDataDirReturnsPromise, getStorageDataDirWithCallback };
+
+ /**
+ * Get the user data path.
+ *
+ * @returns { Promise } return Promise
+ * @throws { BusinessError } 202 - The caller is not a system application
+ * @throws { BusinessError } 13900020 - Invalid argument
+ * @throws { BusinessError } 13900042 - Unknown error
+ * @syscap SystemCapability.FileManagement.File.Environment
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function getStorageDataDirReturnsPromise(): Promise;
+
+ /**
+ * Get the user data path.
+ *
+ * @param { AsyncCallback } callback - callback
+ * @throws { BusinessError } 202 - The caller is not a system application
+ * @throws { BusinessError } 13900020 - Invalid argument
+ * @throws { BusinessError } 13900042 - Unknown error
+ * @syscap SystemCapability.FileManagement.File.Environment
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function getStorageDataDirWithCallback(callback: AsyncCallback): void;
+
/**
* Get the User storage path.
*
@@ -66,8 +98,7 @@ declare namespace Environment {
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.Environment
* @systemapi
- * @since arkts {'1.1':'8','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 8
*/
function getUserDataDir(): Promise;
@@ -80,11 +111,44 @@ declare namespace Environment {
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.Environment
* @systemapi
- * @since arkts {'1.1':'8','1.2':'20'}
- * @arkts 1.1&1.2
+ * @since 8
*/
function getUserDataDir(callback: AsyncCallback): void;
+ /**
+ * @since 20
+ * @arkts 1.2
+ */
+ overload getUserDataDir { getUserDataDirReturnsPromise, getUserDataDirWithCallback };
+
+ /**
+ * Get the User storage path.
+ *
+ * @returns { Promise } return Promise
+ * @throws { BusinessError } 202 - The caller is not a system application
+ * @throws { BusinessError } 13900020 - Invalid argument
+ * @throws { BusinessError } 13900042 - Unknown error
+ * @syscap SystemCapability.FileManagement.File.Environment
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function getUserDataDirReturnsPromise(): Promise;
+
+ /**
+ * Get the User storage path.
+ *
+ * @param { AsyncCallback } callback - callback
+ * @throws { BusinessError } 202 - The caller is not a system application
+ * @throws { BusinessError } 13900020 - Invalid argument
+ * @throws { BusinessError } 13900042 - Unknown error
+ * @syscap SystemCapability.FileManagement.File.Environment
+ * @systemapi
+ * @since 20
+ * @arkts 1.2
+ */
+ function getUserDataDirWithCallback(callback: AsyncCallback): void;
+
/**
* Get the public download directory.
*
diff --git a/api/@ohos.file.fs.d.ets b/api/@ohos.file.fs.d.ets
index 735f45cac824afe38c3631439c4191088bb3f83d..4f32a2a4ef5bce57393ff42b44e6b45308962be8 100644
--- a/api/@ohos.file.fs.d.ets
+++ b/api/@ohos.file.fs.d.ets
@@ -160,11 +160,9 @@ declare namespace fileIo {
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function access(path: string, mode?: AccessModeType): Promise;
+function accessReturnsPromise(path: string, mode?: AccessModeType): Promise;
/**
* Access file.
@@ -184,11 +182,9 @@ function access(path: string, mode?: AccessModeType): Promise;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function access(path: string, callback: AsyncCallback): void;
+function accessWithCallback(path: string, callback: AsyncCallback): void;
/**
* Access file.
@@ -211,7 +207,12 @@ function access(path: string, callback: AsyncCallback): void;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise;
+function accessWithFlagReturnsPromise(path: string, mode: AccessModeType, flag: AccessFlagType): Promise;
+
+/**
+ * @since 20
+ */
+overload access { accessReturnsPromise, accessWithCallback, accessWithFlagReturnsPromise };
/**
*
@@ -233,11 +234,9 @@ function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promi
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function accessSync(path: string, mode?: AccessModeType): boolean;
+function accessSyncWithPathMode(path: string, mode?: AccessModeType): boolean;
/**
* Access file with sync interface.
@@ -260,7 +259,12 @@ function accessSync(path: string, mode?: AccessModeType): boolean;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean;
+function accessSyncWithPathModeFlag(path: string, mode: AccessModeType, flag: AccessFlagType): boolean;
+
+/**
+ * @since 20
+ */
+overload accessSync { accessSyncWithPathMode, accessSyncWithPathModeFlag };
/**
* Close file or fd.
@@ -274,11 +278,9 @@ function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): b
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function close(file: int | File): Promise;
+function closeReturnsPromise(file: int | File): Promise;
/**
* Close file or fd.
@@ -292,11 +294,14 @@ function close(file: int | File): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function close(file: int | File, callback: AsyncCallback): void;
+function closeWithCallback(file: int | File, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload close { closeReturnsPromise, closeWithCallback };
/**
* Close file or fd with sync interface.
@@ -309,8 +314,6 @@ function close(file: int | File, callback: AsyncCallback): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
function closeSync(file: int | File): void;
@@ -352,7 +355,7 @@ function closeSync(file: int | File): void;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise;
+function copyReturnsPromise(srcUri: string, destUri: string, options?: CopyOptions): Promise;
/**
* Copy file or directory.
@@ -389,7 +392,7 @@ function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise): void;
+function copyWithCallback(srcUri: string, destUri: string, callback: AsyncCallback): void;
/**
* Copy file or directory.
@@ -427,7 +430,13 @@ function copy(srcUri: string, destUri: string, callback: AsyncCallback): v
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback): void;
+function copyWithOptionsCallback(srcUri: string, destUri: string,
+ options: CopyOptions, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload copy { copyReturnsPromise, copyWithCallback, copyWithOptionsCallback };
/**
* Copy directory.
@@ -457,7 +466,7 @@ function copy(srcUri: string, destUri: string, options: CopyOptions, callback: A
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function copyDir(src: string, dest: string, mode?: int): Promise;
+function copyDirReturnsPromise(src: string, dest: string, mode?: int): Promise;
/**
* Copy directory.
@@ -485,7 +494,7 @@ function copyDir(src: string, dest: string, mode?: int): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function copyDir(src: string, dest: string, callback: AsyncCallback): void;
+function copyDirWithCallback(src: string, dest: string, callback: AsyncCallback): void;
/**
* Copy directory.
@@ -497,7 +506,8 @@ function copyDir(src: string, dest: string, callback: AsyncCallback): void
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function copyDir(src: string, dest: string, callback: AsyncCallback>): void;
+function copyDirWithCallbackOfArrayOfConflictFiles(src: string, dest: string,
+ callback: AsyncCallback>): void;
/**
* Copy directory.
@@ -526,7 +536,7 @@ function copyDir(src: string, dest: string, callback: AsyncCallback): void;
+function copyDirWithModeCallback(src: string, dest: string, mode: int, callback: AsyncCallback): void;
/**
* Copy directory.
@@ -539,7 +549,15 @@ function copyDir(src: string, dest: string, mode: int, callback: AsyncCallback>): void;
+function copyDirWithModeCallbackOfArrayOfConflictFiles(src: string, dest: string,
+ mode: int, callback: AsyncCallback>): void;
+
+/**
+ * @since 20
+ */
+overload copyDir { copyDirReturnsPromise, copyDirWithCallback,
+ copyDirWithCallbackOfArrayOfConflictFiles, copyDirWithModeCallback,
+ copyDirWithModeCallbackOfArrayOfConflictFiles};
/**
* Copy directory with sync interface.
@@ -597,11 +615,9 @@ function copyDirSync(src: string, dest: string, mode?: int): void;
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 13900044 - Network is unreachable
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function copyFile(src: string | int, dest: string | int, mode?: int): Promise;
+function copyFileReturnsPromise(src: string | int, dest: string | int, mode?: int): Promise;
/**
* Copy file.
@@ -627,11 +643,9 @@ function copyFile(src: string | int, dest: string | int, mode?: int): Promise): void;
+function copyFileWithCallback(src: string | int, dest: string | int, callback: AsyncCallback): void;
/**
* Copy file.
@@ -658,17 +672,20 @@ function copyFile(src: string | int, dest: string | int, callback: AsyncCallback
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function copyFile(
+function copyFileWithModeCallback(
src: string | int,
dest: string | int,
mode: int,
callback: AsyncCallback
): void;
+/**
+ * @since 20
+ */
+overload copyFile { copyFileReturnsPromise, copyFileWithCallback, copyFileWithModeCallback };
+
/**
* Copy file with sync interface.
*
@@ -736,7 +753,7 @@ function copyFileSync(src: string | int, dest: string | int, mode?: int): void;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function createStream(path: string, mode: string): Promise;
+function createStreamReturnsPromise(path: string, mode: string): Promise;
/**
* Create class Stream.
@@ -773,7 +790,12 @@ function createStream(path: string, mode: string): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function createStream(path: string, mode: string, callback: AsyncCallback): void;
+function createStreamWithCallback(path: string, mode: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload createStream { createStreamReturnsPromise, createStreamWithCallback };
/**
* Create class Stream with sync interface.
@@ -850,7 +872,7 @@ function createStreamSync(path: string, mode: string): Stream;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function createRandomAccessFile(file: string | File, mode?: int,
+function createRandomAccessFileReturnsPromise(file: string | File, mode?: int,
options?: RandomAccessFileOptions): Promise;
/**
@@ -887,7 +909,7 @@ function createRandomAccessFile(file: string | File, mode?: int,
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function createRandomAccessFile(file: string | File, callback: AsyncCallback): void;
+function createRandomAccessFileWithCallback(file: string | File, callback: AsyncCallback): void;
/**
* Create class RandomAccessFile.
@@ -924,7 +946,14 @@ function createRandomAccessFile(file: string | File, callback: AsyncCallback): void;
+function createRandomAccessFileWithModeCallback(file: string | File, mode: int,
+ callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload createRandomAccessFile { createRandomAccessFileReturnsPromise, createRandomAccessFileWithCallback,
+ createRandomAccessFileWithModeCallback };
/**
* Create class RandomAccessFile with sync interface.
@@ -1077,10 +1106,9 @@ function dup(fd: int): File;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function fdatasync(fd: int): Promise;
+function fdatasyncReturnsPromise(fd: int): Promise;
/**
* Synchronize file metadata.
@@ -1095,10 +1123,14 @@ function fdatasync(fd: int): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function fdatasync(fd: int, callback: AsyncCallback): void;
+function fdatasyncWithCallback(fd: int, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload fdatasync { fdatasyncReturnsPromise, fdatasyncWithCallback };
/**
* Synchronize file metadata with sync interface.
@@ -1153,7 +1185,7 @@ function fdatasyncSync(fd: int): void;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function fdopenStream(fd: int, mode: string): Promise;
+function fdopenStreamReturnsPromise(fd: int, mode: string): Promise;
/**
* Create class Stream by using fd.
@@ -1191,7 +1223,12 @@ function fdopenStream(fd: int, mode: string): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function fdopenStream(fd: int, mode: string, callback: AsyncCallback): void;
+function fdopenStreamWithCallback(fd: int, mode: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload fdopenStream { fdopenStreamReturnsPromise, fdopenStreamWithCallback };
/**
* Create class Stream by using fd with sync interface.
@@ -1244,10 +1281,9 @@ function fdopenStreamSync(fd: int, mode: string): Stream;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function fsync(fd: int): Promise;
+function fsyncReturnsPromise(fd: int): Promise;
/**
* Synchronize file.
@@ -1262,10 +1298,14 @@ function fsync(fd: int): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function fsync(fd: int, callback: AsyncCallback): void;
+function fsyncWithCallback(fd: int, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload fsync { fsyncReturnsPromise, fsyncWithCallback };
/**
* Synchronize file with sync interface.
@@ -1297,11 +1337,9 @@ function fsyncSync(fd: int): void;
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function listFile(
+function listFileReturnsPromise(
path: string,
options?: ListFileOptions
): Promise;
@@ -1318,11 +1356,9 @@ function listFile(
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function listFile(path: string, callback: AsyncCallback): void;
+function listFileWithCallback(path: string, callback: AsyncCallback): void;
/**
* List file.
@@ -1337,16 +1373,19 @@ function listFile(path: string, callback: AsyncCallback): void;
* @throws { BusinessError } 13900018 - Not a directory
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function listFile(
+function listFileWithOptionsCallback(
path: string,
options: ListFileOptions,
callback: AsyncCallback
): void;
+/**
+ * @since 20
+ */
+overload listFile { listFileReturnsPromise, listFileWithCallback, listFileWithOptionsCallback };
+
/**
* List file with sync interface.
*
@@ -1404,7 +1443,7 @@ function lseek(fd: int, offset: long, whence?: WhenceType): long;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function lstat(path: string): Promise;
+function lstatReturnsPromise(path: string): Promise;
/**
* Stat link file.
@@ -1424,7 +1463,12 @@ function lstat(path: string): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function lstat(path: string, callback: AsyncCallback): void;
+function lstatWithCallback(path: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload lstat { lstatReturnsPromise, lstatWithCallback };
/**
* Stat link file with sync interface.
@@ -1467,11 +1511,9 @@ function lstatSync(path: string): Stat;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdir(path: string): Promise;
+function mkdirReturnsPromise(path: string): Promise;
/**
* Make dir.
@@ -1495,11 +1537,9 @@ function mkdir(path: string): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdir(path: string, recursion: boolean): Promise;
+function mkdirWithRecursionReturnsPromise(path: string, recursion: boolean): Promise;
/**
* Make dir.
@@ -1522,11 +1562,9 @@ function mkdir(path: string, recursion: boolean): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdir(path: string, callback: AsyncCallback): void;
+function mkdirWithCallback(path: string, callback: AsyncCallback): void;
/**
* Make dir.
@@ -1550,11 +1588,15 @@ function mkdir(path: string, callback: AsyncCallback): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdir(path: string, recursion: boolean, callback: AsyncCallback): void;
+function mkdirWithRecursionCallback(path: string, recursion: boolean, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload mkdir { mkdirReturnsPromise, mkdirWithRecursionReturnsPromise,
+ mkdirWithCallback, mkdirWithRecursionCallback };
/**
* Make dir with sync interface.
@@ -1576,11 +1618,9 @@ function mkdir(path: string, recursion: boolean, callback: AsyncCallback):
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdirSync(path: string): void;
+function mkdirSyncWithPath(path: string): void;
/**
* Make dir with sync interface.
@@ -1603,11 +1643,14 @@ function mkdirSync(path: string): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function mkdirSync(path: string, recursion: boolean): void;
+function mkdirSyncWithPathRecursion(path: string, recursion: boolean): void;
+
+/**
+ * @since 20
+ */
+overload mkdirSync { mkdirSyncWithPath, mkdirSyncWithPathRecursion };
/**
* Make temp dir.
@@ -1630,10 +1673,9 @@ function mkdirSync(path: string, recursion: boolean): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function mkdtemp(prefix: string): Promise;
+function mkdtempReturnsPromise(prefix: string): Promise;
/**
* Make temp dir.
@@ -1656,10 +1698,14 @@ function mkdtemp(prefix: string): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function mkdtemp(prefix: string, callback: AsyncCallback): void;
+function mkdtempWithCallback(prefix: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload mkdtemp { mkdtempReturnsPromise, mkdtempWithCallback };
/**
* Make temp dir with sync interface.
@@ -1716,7 +1762,7 @@ function mkdtempSync(prefix: string): string;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function moveDir(src: string, dest: string, mode?: int): Promise;
+function moveDirReturnsPromise(src: string, dest: string, mode?: int): Promise;
/**
* Move directory.
@@ -1745,7 +1791,7 @@ function moveDir(src: string, dest: string, mode?: int): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function moveDir(src: string, dest: string, callback: AsyncCallback): void;
+function moveDirWithCallback(src: string, dest: string, callback: AsyncCallback): void;
/**
* Move directory.
@@ -1757,7 +1803,8 @@ function moveDir(src: string, dest: string, callback: AsyncCallback): void
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function moveDir(src: string, dest: string, callback: AsyncCallback>): void;
+function moveDirWithCallbackOfArrayOfConflictFiles(src: string, dest: string,
+ callback: AsyncCallback>): void;
/**
* Move directory.
@@ -1787,7 +1834,7 @@ function moveDir(src: string, dest: string, callback: AsyncCallback): void;
+function moveDirWithModeCallback(src: string, dest: string, mode: int, callback: AsyncCallback): void;
/**
* Move directory.
@@ -1800,7 +1847,15 @@ function moveDir(src: string, dest: string, mode: int, callback: AsyncCallback>): void;
+function moveDirWithModeCallbackOfArrayOfConflictFiles(src: string, dest: string,
+ mode: int, callback: AsyncCallback>): void;
+
+/**
+ * @since 20
+ */
+overload moveDir { moveDirReturnsPromise, moveDirWithCallback,
+ moveDirWithCallbackOfArrayOfConflictFiles, moveDirWithModeCallback,
+ moveDirWithModeCallbackOfArrayOfConflictFiles };
/**
* Move directory with sync interface.
@@ -1859,10 +1914,9 @@ function moveDirSync(src: string, dest: string, mode?: int): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function moveFile(src: string, dest: string, mode?: int): Promise;
+function moveFileReturnsPromise(src: string, dest: string, mode?: int): Promise;
/**
* Move file.
@@ -1890,10 +1944,9 @@ function moveFile(src: string, dest: string, mode?: int): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function moveFile(src: string, dest: string, callback: AsyncCallback): void;
+function moveFileWithCallback(src: string, dest: string, callback: AsyncCallback): void;
/**
* Move file.
@@ -1922,10 +1975,14 @@ function moveFile(src: string, dest: string, callback: AsyncCallback): voi
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
* @since 20
*/
-function moveFile(src: string, dest: string, mode: int, callback: AsyncCallback): void;
+function moveFileWithModeCallback(src: string, dest: string, mode: int, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload moveFile { moveFileReturnsPromise, moveFileWithCallback, moveFileWithModeCallback };
/**
* Move file with sync interface.
@@ -1992,11 +2049,9 @@ function moveFileSync(src: string, dest: string, mode?: int): void;
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 13900044 - Network is unreachable
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function open(path: string, mode?: int): Promise;
+function openReturnsPromise(path: string, mode?: int): Promise;
/**
* Open file.
@@ -2030,11 +2085,9 @@ function open(path: string, mode?: int): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function open(path: string, callback: AsyncCallback): void;
+function openWithCallback(path: string, callback: AsyncCallback): void;
/**
* Open file.
@@ -2069,11 +2122,14 @@ function open(path: string, callback: AsyncCallback): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function open(path: string, mode: int, callback: AsyncCallback): void;
+function openWithModeCallback(path: string, mode: int, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload open { openReturnsPromise, openWithCallback, openWithModeCallback };
/**
* Open file with sync interface.
@@ -2133,11 +2189,9 @@ function openSync(path: string, mode?: int): File;
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 13900044 - Network is unreachable
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function read(
+function readReturnsPromise(
fd: int,
buffer: ArrayBuffer,
options?: ReadOptions
@@ -2159,11 +2213,9 @@ function read(
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function read(fd: int, buffer: ArrayBuffer, callback: AsyncCallback): void;
+function readWithCallback(fd: int, buffer: ArrayBuffer, callback: AsyncCallback): void;
/**
* Read file.
@@ -2182,17 +2234,20 @@ function read(fd: int, buffer: ArrayBuffer, callback: AsyncCallback): void
* @throws { BusinessError } 13900034 - Operation would block
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function read(
+function readWithOptionsCallback(
fd: int,
buffer: ArrayBuffer,
options: ReadOptions,
callback: AsyncCallback
): void;
+/**
+ * @since 20
+ */
+overload read { readReturnsPromise, readWithCallback, readWithOptionsCallback };
+
/**
* Read file with sync interface.
*
@@ -2243,7 +2298,7 @@ function readSync(
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function readLines(filePath: string, options?: Options): Promise;
+function readLinesReturnsPromise(filePath: string, options?: Options): Promise;
/**
* Read content line by line.
@@ -2265,7 +2320,7 @@ function readLines(filePath: string, options?: Options): Promise
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function readLines(filePath: string, callback: AsyncCallback): void;
+function readLinesWithCallback(filePath: string, callback: AsyncCallback): void;
/**
* Read content line by line.
@@ -2288,7 +2343,13 @@ function readLines(filePath: string, callback: AsyncCallback): v
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function readLines(filePath: string, options: Options, callback: AsyncCallback): void;
+function readLinesWithOptionsCallback(filePath: string, options: Options,
+ callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload readLines { readLinesReturnsPromise, readLinesWithCallback, readLinesWithOptionsCallback };
/**
* Read content line by line with sync interface.
@@ -2335,11 +2396,9 @@ function readLinesSync(filePath: string, options?: Options): ReaderIterator;
* @throws { BusinessError } 13900042 - Unknown error
* @throws { BusinessError } 13900044 - Network is unreachable
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function readText(
+function readTextReturnsPromise(
filePath: string,
options?: ReadTextOptions
): Promise;
@@ -2363,11 +2422,9 @@ function readText(
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function readText(filePath: string, callback: AsyncCallback): void;
+function readTextWithCallback(filePath: string, callback: AsyncCallback): void;
/**
* Read text.
@@ -2389,16 +2446,19 @@ function readText(filePath: string, callback: AsyncCallback): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function readText(
+function readTextWithOptionsCallback(
filePath: string,
options: ReadTextOptions,
callback: AsyncCallback
): void;
+/**
+ * @since 20
+ */
+overload readText { readTextReturnsPromise, readTextWithCallback, readTextWithOptionsCallback };
+
/**
* Read text with sync interface.
*
@@ -2455,11 +2515,9 @@ function readTextSync(
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function rename(oldPath: string, newPath: string): Promise;
+function renameReturnsPromise(oldPath: string, newPath: string): Promise;
/**
* Rename file.
@@ -2487,11 +2545,14 @@ function rename(oldPath: string, newPath: string): Promise;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function rename(oldPath: string, newPath: string, callback: AsyncCallback): void;
+function renameWithCallback(oldPath: string, newPath: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload rename { renameReturnsPromise, renameWithCallback };
/**
* Rename file with sync interface.
@@ -2542,11 +2603,9 @@ function renameSync(oldPath: string, newPath: string): void;
* @throws { BusinessError } 13900032 - Directory not empty
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function rmdir(path: string): Promise;
+function rmdirReturnsPromise(path: string): Promise;
/**
* Delete dir.
@@ -2566,11 +2625,14 @@ function rmdir(path: string): Promise;
* @throws { BusinessError } 13900032 - Directory not empty
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function rmdir(path: string, callback: AsyncCallback): void;
+function rmdirWithCallback(path: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload rmdir { rmdirReturnsPromise, rmdirWithCallback };
/**
* Delete dir with sync interface.
@@ -2614,11 +2676,9 @@ function rmdirSync(path: string): void;
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function stat(file: string | int): Promise;
+function statReturnsPromise(file: string | int): Promise;
/**
* Get file information.
@@ -2639,11 +2699,14 @@ function stat(file: string | int): Promise;
* @throws { BusinessError } 13900038 - Value too large for defined data type
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function stat(file: string | int, callback: AsyncCallback): void;
+function statWithCallback(file: string | int, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload stat { statReturnsPromise, statWithCallback };
/**
* Get file information with sync interface.
@@ -2693,7 +2756,7 @@ function statSync(file: string | int): Stat;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function symlink(target: string, srcPath: string): Promise;
+function symlinkReturnsPromise(target: string, srcPath: string): Promise;
/**
* Link file.
@@ -2718,7 +2781,12 @@ function symlink(target: string, srcPath: string): Promise;
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
-function symlink(target: string, srcPath: string, callback: AsyncCallback): void;
+function symlinkWithCallback(target: string, srcPath: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload symlink { symlinkReturnsPromise, symlinkWithCallback };
/**
* Link file with sync interface.
@@ -2767,11 +2835,9 @@ function symlinkSync(target: string, srcPath: string): void;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function truncate(file: string | int, len?: long): Promise;
+function truncateReturnsPromise(file: string | int, len?: long): Promise;
/**
* Truncate file.
@@ -2795,11 +2861,9 @@ function truncate(file: string | int, len?: long): Promise;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function truncate(file: string | int, callback: AsyncCallback): void;
+function truncateWithCallback(file: string | int, callback: AsyncCallback): void;
/**
* Truncate file.
@@ -2824,11 +2888,14 @@ function truncate(file: string | int, callback: AsyncCallback): void;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function truncate(file: string | int, len: long, callback: AsyncCallback): void;
+function truncateWithLenCallback(file: string | int, len: long, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload truncate { truncateReturnsPromise, truncateWithCallback, truncateWithLenCallback };
/**
* Truncate file with sync interface.
@@ -2879,11 +2946,9 @@ function truncateSync(file: string | int, len?: long): void;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function unlink(path: string): Promise;
+function unlinkReturnsPromise(path: string): Promise;
/**
* Delete file.
@@ -2906,11 +2971,14 @@ function unlink(path: string): Promise;
* @throws { BusinessError } 13900033 - Too many symbolic links encountered
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function unlink(path: string, callback: AsyncCallback): void;
+function unlinkWithCallback(path: string, callback: AsyncCallback): void;
+
+/**
+ * @since 20
+ */
+overload unlink { unlinkReturnsPromise, unlinkWithCallback };
/**
* Delete file with sync interface.
@@ -2975,11 +3043,9 @@ function utimes(path: string, mtime: double): void;
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function write(
+function writeReturnsPromise(
fd: int,
buffer: ArrayBuffer | string,
options?: WriteOptions
@@ -3004,11 +3070,9 @@ function write(
* @throws { BusinessError } 13900041 - Quota exceeded
* @throws { BusinessError } 13900042 - Unknown error
* @syscap SystemCapability.FileManagement.File.FileIO
- * @crossplatform
- * @atomicservice
* @since 20
*/
-function write(fd: int, buffer: ArrayBuffer | string, callback: AsyncCallback): void;
+function writeWithCallback(fd: int, buffer: ArrayBuffer | string, callback: AsyncCallback): void;
/**
* Write file.
@@ -3030,17 +3094,20 @@ function write(fd: int, buffer: ArrayBuffer | string, callback: AsyncCallback
): void;
+/**
+ * @since 20
+ */
+overload write { writeReturnsPromise, writeWithCallback, writeWithOptionsCallback };
+
/**
* Write file with sync interface.
*
@@ -3356,7 +3423,7 @@ interface File {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- lock(exclusive?: boolean): Promise;
+ lockReturnsPromise(exclusive?: boolean): Promise;
/**
* Lock file with blocking method.
@@ -3371,7 +3438,7 @@ interface File {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- lock(callback: AsyncCallback): void;
+ lockWithCallback(callback: AsyncCallback): void;
/**
* Lock file with blocking method.
@@ -3387,7 +3454,12 @@ interface File {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- lock(exclusive: boolean, callback: AsyncCallback): void;
+ lockWithExclusiveCallback(exclusive: boolean, callback: AsyncCallback): void;
+
+ /**
+ * @since 20
+ */
+ overload lock { lockReturnsPromise, lockWithCallback, lockWithExclusiveCallback };
/**
* Try to lock file with returning results immediately.
@@ -3497,7 +3569,7 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- write(
+ writeReturnsPromise(
buffer: ArrayBuffer | string,
options?: WriteOptions
): Promise;
@@ -3522,7 +3594,7 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- write(buffer: ArrayBuffer | string, callback: AsyncCallback): void;
+ writeWithCallback(buffer: ArrayBuffer | string, callback: AsyncCallback): void;
/**
* Write randomAccessFile.
@@ -3545,12 +3617,17 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- write(
+ writeWithOptionsCallback(
buffer: ArrayBuffer | string,
options: WriteOptions,
callback: AsyncCallback
): void;
+ /**
+ * @since 20
+ */
+ overload write { writeReturnsPromise, writeWithCallback, writeWithOptionsCallback };
+
/**
* Write randomAccessFile with sync interface.
*
@@ -3596,7 +3673,7 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- read(
+ readReturnsPromise(
buffer: ArrayBuffer,
options?: ReadOptions
): Promise;
@@ -3618,7 +3695,7 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- read(buffer: ArrayBuffer, callback: AsyncCallback): void;
+ readWithCallback(buffer: ArrayBuffer, callback: AsyncCallback): void;
/**
* Read randomAccessFile.
@@ -3638,12 +3715,17 @@ interface RandomAccessFile {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- read(
+ readWithOptionsCallback(
buffer: ArrayBuffer,
options: ReadOptions,
callback: AsyncCallback
): void;
+ /**
+ * @since 20
+ */
+ overload read { readReturnsPromise, readWithCallback, readWithOptionsCallback };
+
/**
* Read randomAccessFile with sync interface.
*
@@ -4179,7 +4261,7 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- close(): Promise;
+ closeReturnsPromise(): Promise;
/**
* Close stream.
@@ -4194,7 +4276,12 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- close(callback: AsyncCallback): void;
+ closeWithCallback(callback: AsyncCallback): void;
+
+ /**
+ * @since 20
+ */
+ overload close { closeReturnsPromise, closeWithCallback };
/**
* Close stream with sync interface.
@@ -4229,7 +4316,7 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- flush(): Promise;
+ flushReturnsPromise(): Promise;
/**
* Flush stream.
@@ -4250,7 +4337,12 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- flush(callback: AsyncCallback): void;
+ flushWithCallback(callback: AsyncCallback): void;
+
+ /**
+ * @since 20
+ */
+ overload flush { flushReturnsPromise, flushWithCallback };
/**
* Flush stream with sync interface.
@@ -4293,7 +4385,7 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- write(
+ writeReturnsPromise(
buffer: ArrayBuffer | string,
options?: WriteOptions
): Promise;
@@ -4318,7 +4410,7 @@ interface Stream {
* @syscap SystemCapability.FileManagement.File.FileIO
* @since 20
*/
- write(buffer: ArrayBuffer | string, callback: AsyncCallback