From bd57078919172bc6d9156c1ad74513c1c9a86ae8 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 29 Sep 2022 15:57:30 +0800 Subject: [PATCH 01/20] =?UTF-8?q?api=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: niudongyao --- .idea/.gitignore | 8 ++ .idea/interface_sdk-js.iml | 8 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ api/@ohos.data.dataShare.d.ts | 184 +++++++++++++++++++++++++++++++++- 5 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/interface_sdk-js.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..73f69e0958 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml new file mode 100644 index 0000000000..bc2cd87409 --- /dev/null +++ b/.idea/interface_sdk-js.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..732dc43fc9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index a773ff1954..10d8314da3 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -33,6 +33,22 @@ declare namespace dataShare { function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; function createDataShareHelper(context: Context, uri: string): Promise; + /** + * Obtains the dataShareHelper. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param context Indicates the application context. + * @param uri Indicates the path of the file to open. + * @return Returns the dataShareHelper. + * @throws {BusinessError} if process failed + * @errorcode 157000010 + * @errorcode 401 + * @StageModelOnly + */ + function createDataShareHelperV9(context: Context, uri: string, callback: AsyncCallback): void; + function createDataShareHelperV9(context: Context, uri: string): Promise; + /** * DataShareHelper * @since 9 @@ -183,6 +199,172 @@ declare namespace dataShare { notifyChange(uri: string, callback: AsyncCallback): void; notifyChange(uri: string): Promise; } + + /** + * DataShareHelperV9 + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + */ + interface DataShareHelperV9 { + /** + * Registers an observer to observe data specified by the given uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the callback when dataChange. + * @return - + * @StageModelOnly + */ + on(type: 'dataChange', uri: string, callback: AsyncCallback): void; + + /** + * Deregisters an observer used for monitoring data specified by the given uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the registered callback. + * @return - + * @StageModelOnly + */ + off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; + + /** + * Inserts a single data record into the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @return Returns the index of the inserted data record. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; + insert(uri: string, value: ValuesBucket): Promise; + + /** + * Deletes one or more data records from the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records deleted. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Queries data in the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of data to query. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. + * @return Returns the query result. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; + + /** + * Updates data records in the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of data to update. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param value Indicates the data to update. This parameter can be null. + * @return Returns the number of data records updated. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; + + /** + * Inserts multiple data records into the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param values Indicates the data records to insert. + * @return Returns the number of data records inserted. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + batchInsert(uri: string, values: Array, callback: AsyncCallback): void; + batchInsert(uri: string, values: Array): Promise; + + /** + * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. + * A normalized uri can be used across devices, persisted, backed up, and restored. + *

To transfer a normalized uri from another environment to the current environment, you should call this + * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} + * to convert it to a denormalized uri that can be used only in the current environment. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; + * returns {@code null} otherwise. + * @throws DataShareRemoteException Throws this exception if the remote process exits. + * @throws NullPointerException Throws this exception if {@code uri} is null. + * @see #denormalizeUri + * @StageModelOnly + */ + normalizeUri(uri: string, callback: AsyncCallback): void; + normalizeUri(uri: string): Promise; + + /** + * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the + * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data + * identified by the normalized {@code Uri} cannot be found in the current environment. + * @throws DataShareRemoteException Throws this exception if the remote process exits. + * @throws NullPointerException Throws this exception if {@code uri} is null. + * @see #normalizeUri + * @StageModelOnly + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + denormalizeUri(uri: string): Promise; + + /** + * Notifies the registered observers of a change to the data resource specified by Uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @return - + * @StageModelOnly + */ + notifyChange(uri: string, callback: AsyncCallback): void; + notifyChange(uri: string): Promise; + } } -export default dataShare; +export default dataShare; \ No newline at end of file -- Gitee From 76a84856bab9a5e525d6f098291c139e983e9bb2 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 29 Sep 2022 15:58:20 +0800 Subject: [PATCH 02/20] =?UTF-8?q?api=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: niudongyao --- .idea/.gitignore | 8 -------- .idea/interface_sdk-js.iml | 8 -------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 4 files changed, 30 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/interface_sdk-js.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e0958..0000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml deleted file mode 100644 index bc2cd87409..0000000000 --- a/.idea/interface_sdk-js.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 732dc43fc9..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file -- Gitee From af548c7f8645bd8f5fd11125f9c3b9aa09c2c487 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Sun, 9 Oct 2022 14:21:24 +0800 Subject: [PATCH 03/20] api errorcode Signed-off-by: niudongyao --- .idea/interface_sdk-js.iml | 8 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 66 +++++++++++++ api/@ohos.data.dataShare.d.ts | 168 +--------------------------------- 5 files changed, 90 insertions(+), 166 deletions(-) create mode 100644 .idea/interface_sdk-js.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml new file mode 100644 index 0000000000..bc2cd87409 --- /dev/null +++ b/.idea/interface_sdk-js.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..732dc43fc9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..fc09323844 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 10d8314da3..969a702d5b 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -20,19 +20,6 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { - /** - * Obtains the dataShareHelper. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param context Indicates the application context. - * @param uri Indicates the path of the file to open. - * @return Returns the dataShareHelper. - * @StageModelOnly - */ - function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; - function createDataShareHelper(context: Context, uri: string): Promise; - /** * Obtains the dataShareHelper. * @since 9 @@ -46,8 +33,8 @@ declare namespace dataShare { * @errorcode 401 * @StageModelOnly */ - function createDataShareHelperV9(context: Context, uri: string, callback: AsyncCallback): void; - function createDataShareHelperV9(context: Context, uri: string): Promise; + function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; + function createDataShareHelper(context: Context, uri: string): Promise; /** * DataShareHelper @@ -83,157 +70,6 @@ declare namespace dataShare { */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - /** - * Inserts a single data record into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @StageModelOnly - */ - insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; - insert(uri: string, value: ValuesBucket): Promise; - - /** - * Deletes one or more data records from the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @StageModelOnly - */ - delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Queries data in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of data to query. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @return Returns the query result. - * @StageModelOnly - */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; - - /** - * Updates data records in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of data to update. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param value Indicates the data to update. This parameter can be null. - * @return Returns the number of data records updated. - * @StageModelOnly - */ - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; - - /** - * Inserts multiple data records into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param values Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @StageModelOnly - */ - batchInsert(uri: string, values: Array, callback: AsyncCallback): void; - batchInsert(uri: string, values: Array): Promise; - - /** - * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. - * A normalized uri can be used across devices, persisted, backed up, and restored. - *

To transfer a normalized uri from another environment to the current environment, you should call this - * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} - * to convert it to a denormalized uri that can be used only in the current environment. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; - * returns {@code null} otherwise. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #denormalizeUri - * @StageModelOnly - */ - normalizeUri(uri: string, callback: AsyncCallback): void; - normalizeUri(uri: string): Promise; - - /** - * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #normalizeUri - * @StageModelOnly - */ - denormalizeUri(uri: string, callback: AsyncCallback): void; - denormalizeUri(uri: string): Promise; - - /** - * Notifies the registered observers of a change to the data resource specified by Uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @return - - * @StageModelOnly - */ - notifyChange(uri: string, callback: AsyncCallback): void; - notifyChange(uri: string): Promise; - } - - /** - * DataShareHelperV9 - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @StageModelOnly - */ - interface DataShareHelperV9 { - /** - * Registers an observer to observe data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - - * @StageModelOnly - */ - on(type: 'dataChange', uri: string, callback: AsyncCallback): void; - - /** - * Deregisters an observer used for monitoring data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - - * @StageModelOnly - */ - off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - /** * Inserts a single data record into the database. * @since 9 -- Gitee From a0e1424a79933d25149d31ade1b8c6b8b986ac21 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Sun, 9 Oct 2022 14:22:04 +0800 Subject: [PATCH 04/20] api errorcode Signed-off-by: niudongyao --- .idea/interface_sdk-js.iml | 8 ----- .idea/modules.xml | 8 ----- .idea/vcs.xml | 6 ---- .idea/workspace.xml | 66 -------------------------------------- 4 files changed, 88 deletions(-) delete mode 100644 .idea/interface_sdk-js.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml deleted file mode 100644 index bc2cd87409..0000000000 --- a/.idea/interface_sdk-js.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 732dc43fc9..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index fc09323844..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From a740dab862805cccdfca4e407adfa84c00c2e66e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Mon, 10 Oct 2022 10:18:03 +0800 Subject: [PATCH 05/20] api errorcode Signed-off-by: niudongyao --- .idea/vcs.xml | 6 ++++ .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 5 --- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..76ea6ee76f --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 969a702d5b..38369801a8 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -79,7 +79,6 @@ declare namespace dataShare { * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @return Returns the index of the inserted data record. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -95,7 +94,6 @@ declare namespace dataShare { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records deleted. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -112,7 +110,6 @@ declare namespace dataShare { * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. * @return Returns the query result. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -129,7 +126,6 @@ declare namespace dataShare { * @param value Indicates the data to update. This parameter can be null. * @return Returns the number of data records updated. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -145,7 +141,6 @@ declare namespace dataShare { * @param values Indicates the data records to insert. * @return Returns the number of data records inserted. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ -- Gitee From e427636324d003cda907b3cd3a208862e5d5e60b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Mon, 10 Oct 2022 10:18:25 +0800 Subject: [PATCH 06/20] api errorcode Signed-off-by: niudongyao --- .idea/vcs.xml | 6 ---- .idea/workspace.xml | 68 --------------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 76ea6ee76f..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From cff61e02de11ee26b6de8b5b7ee2d55bf8a5bcdb Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 14:56:48 +0800 Subject: [PATCH 07/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 ++++++++++++++ api/@ohos.data.dataShare.d.ts | 167 ++++++++++++++++++++++++---------- 2 files changed, 185 insertions(+), 50 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..74a477b270 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 38369801a8..af59a2c3f8 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -22,129 +22,196 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @since 9 + * @param { context } Context - Indicates the application context. + * @param { uri } string - Indicates the path of the file to open. + * @param { AsyncCallback } callback - the dataShareHelper. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param context Indicates the application context. - * @param uri Indicates the path of the file to open. - * @return Returns the dataShareHelper. - * @throws {BusinessError} if process failed - * @errorcode 157000010 - * @errorcode 401 * @StageModelOnly + * @since 9 */ function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; + + /** + * Obtains the dataShareHelper. + * @param { context } Context - Indicates the application context. + * @param { uri } string - Indicates the path of the file to open. + * @returns { Promise } the dataShareHelper. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15700010 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ function createDataShareHelper(context: Context, uri: string): Promise; /** * DataShareHelper - * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly + * @since 9 */ interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @since 9 + * @param { type } 'dataChange' - dataChange. + * @param { uri } string - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - * @StageModelOnly + * @since 9 */ on(type: 'dataChange', uri: string, callback: AsyncCallback): void; /** * Deregisters an observer used for monitoring data specified by the given uri. - * @since 9 + * @param { type } 'dataChange' - dataChange. + * @param { uri } string - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - * @StageModelOnly + * @since 9 */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; /** * Inserts a single data record into the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { AsyncCallback } callback - the index of the inserted data record. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a single data record into the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @returns { Promise } the index of the inserted data record. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ insert(uri: string, value: ValuesBucket): Promise; /** * Deletes one or more data records from the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { AsyncCallback } callback - the number of data records deleted. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Deletes one or more data records from the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @returns { Promise } the number of data records deleted. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Queries data in the database. - * @since 9 + * @param { uri } string - Indicates the path of data to query. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { AsyncCallback } callback - the query result. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of data to query. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @return Returns the query result. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { uri } string - Indicates the path of data to query. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @returns { Promise } - the query result. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; /** * Updates data records in the database. - * @since 9 + * @param { uri } string - Indicates the path of data to update. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { AsyncCallback } callback - the number of data records updated. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of data to update. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param value Indicates the data to update. This parameter can be null. - * @return Returns the number of data records updated. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + + /** + * Updates data records in the database. + * @param { uri } string - Indicates the path of data to update. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @returns { Promise } the number of data records updated. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; /** * Inserts multiple data records into the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { values } Array - Indicates the data records to insert. + * @param { AsyncCallback } callback - the number of data records inserted. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param values Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ batchInsert(uri: string, values: Array, callback: AsyncCallback): void; + + /** + * Inserts multiple data records into the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { values } Array - Indicates the data records to insert. + * @returns { Promise } the number of data records inserted. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ batchInsert(uri: string, values: Array): Promise; /** -- Gitee From b476e5f240e5a0a60cca128c27b4ea167eb037e7 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 14:57:12 +0800 Subject: [PATCH 08/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 74a477b270..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From db71dd91cca7a099869f4688c0d21a5431d18a2a Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 15:03:43 +0800 Subject: [PATCH 09/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 7 ++++ 2 files changed, 75 insertions(+) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..0004705bd8 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index af59a2c3f8..8e58a8f527 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -19,6 +19,13 @@ import DataShareResultSet from './@ohos.data.DataShareResultSet'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; +/** +* This module provides the dataShare capability for consumer. +* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer +* @systemapi +* @StageModelOnly +* @since 9 + */ declare namespace dataShare { /** * Obtains the dataShareHelper. -- Gitee From b4317bf15119b2bfabf1d5c9b713b2881a632a2e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 15:03:57 +0800 Subject: [PATCH 10/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0004705bd8..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From e3c508915807affd6f6b15760b22acfc4f8f5ee5 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 09:56:17 +0800 Subject: [PATCH 11/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 64 ++++++++++++++++----------------- 2 files changed, 100 insertions(+), 32 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..53649ef027 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 8e58a8f527..6500ba78ce 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -29,8 +29,8 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { context } Context - Indicates the application context. - * @param { uri } string - Indicates the path of the file to open. + * @param { Context } context - Indicates the application context. + * @param { string } uri - Indicates the path of the file to open. * @param { AsyncCallback } callback - the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. @@ -43,8 +43,8 @@ declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { context } Context - Indicates the application context. - * @param { uri } string - Indicates the path of the file to open. + * @param { Context } context - Indicates the application context. + * @param { string } uri - Indicates the path of the file to open. * @returns { Promise } the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. * @throws { BusinessError } 15700010 - the parameter check failed. @@ -65,8 +65,8 @@ declare namespace dataShare { interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @param { type } 'dataChange' - dataChange. - * @param { uri } string - Indicates the path of the data to operate. + * @param { string } type - must be 'dataChange'. + * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi @@ -77,8 +77,8 @@ declare namespace dataShare { /** * Deregisters an observer used for monitoring data specified by the given uri. - * @param { type } 'dataChange' - dataChange. - * @param { uri } string - Indicates the path of the data to operate. + * @param { string } type - must be 'dataChange'. + * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi @@ -89,8 +89,8 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { string } uri - Indicates the path of the data to operate. + * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @param { AsyncCallback } callback - the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -102,8 +102,8 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { string } uri - Indicates the path of the data to operate. + * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @returns { Promise } the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -115,8 +115,8 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { string } uri - Indicates the path of the data to operate. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. * @param { AsyncCallback } callback - the number of data records deleted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -128,8 +128,8 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { string } uri - Indicates the path of the data to operate. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. * @returns { Promise } the number of data records deleted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -141,9 +141,9 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { uri } string - Indicates the path of data to query. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { string } uri - Indicates the path of data to query. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. * @param { AsyncCallback } callback - the query result. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -155,9 +155,9 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { uri } string - Indicates the path of data to query. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { string } uri - Indicates the path of data to query. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. * @returns { Promise } - the query result. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -169,9 +169,9 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { uri } string - Indicates the path of data to update. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { string } uri - Indicates the path of data to update. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. * @param { AsyncCallback } callback - the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -183,9 +183,9 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { uri } string - Indicates the path of data to update. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { string } uri - Indicates the path of data to update. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. * @returns { Promise } the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -197,8 +197,8 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { values } Array - Indicates the data records to insert. + * @param { string } uri - Indicates the path of the data to operate. + * @param { Array } values - Indicates the data records to insert. * @param { AsyncCallback } callback - the number of data records inserted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -210,8 +210,8 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { values } Array - Indicates the data records to insert. + * @param { string } uri - Indicates the path of the data to operate. + * @param { Array } values - Indicates the data records to insert. * @returns { Promise } the number of data records inserted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer -- Gitee From 3b467f8a3a9c0a90398b00e50f1bec5d9fc118b6 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 09:56:29 +0800 Subject: [PATCH 12/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 53649ef027..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From ac52ad6285c10aefa34c11a80422b93dce8c2c0b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:14:47 +0800 Subject: [PATCH 13/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 63 +++++++++++++++++++++++--------- 2 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..dbc96ba6ca --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 6500ba78ce..4abaaa4c1c 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -227,47 +227,76 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @param { AsyncCallback } callback - the normalized Uri if the DataShare supports uri normalization; * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; - * returns {@code null} otherwise. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #denormalizeUri * @StageModelOnly + * @since 9 */ normalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. + * A normalized uri can be used across devices, persisted, backed up, and restored. + *

To transfer a normalized uri from another environment to the current environment, you should call this + * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} + * to convert it to a denormalized uri that can be used only in the current environment. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @returns { Promise } the normalized Uri if the DataShare supports uri normalization; + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ normalizeUri(uri: string): Promise; /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @param { AsyncCallback } callback - the denormalized {@code Uri} object if the denormalization is successful; returns the + * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data + * identified by the normalized {@code Uri} cannot be found in the current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the + * @StageModelOnly + * @since 9 + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @returns { Promise } the denormalized {@code Uri} object if the denormalization is successful; returns the * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data * identified by the normalized {@code Uri} cannot be found in the current environment. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #normalizeUri + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi * @StageModelOnly + * @since 9 */ - denormalizeUri(uri: string, callback: AsyncCallback): void; denormalizeUri(uri: string): Promise; /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @param { AsyncCallback } callback - callback. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @return - * @StageModelOnly + * @since 9 */ notifyChange(uri: string, callback: AsyncCallback): void; + + /** + * Notifies the registered observers of a change to the data resource specified by Uri. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ notifyChange(uri: string): Promise; } } -- Gitee From 1577c7886297e3a32a9e9b522b31fce956e682be Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:15:01 +0800 Subject: [PATCH 14/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index dbc96ba6ca..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 3bde4fa4368466deaf1b45df7bee65a606a27975 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:46:29 +0800 Subject: [PATCH 15/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..3f2e93fd5d --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 4abaaa4c1c..10715e93ee 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -47,7 +47,7 @@ declare namespace dataShare { * @param { string } uri - Indicates the path of the file to open. * @returns { Promise } the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the parameter check failed. + * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly -- Gitee From a7b0593cbead27fa965672fa889dcf6e64e8235e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:47:05 +0800 Subject: [PATCH 16/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3f2e93fd5d..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 0494ea0d444f5ae58efa305e517e231d559bdc6e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 14:25:31 +0800 Subject: [PATCH 17/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 ++++++++++++++ api/@ohos.data.dataShare.d.ts | 165 ++++++++++++++++++---------------- 2 files changed, 157 insertions(+), 76 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..beba9e5e49 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 10715e93ee..0e9248525a 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -29,11 +29,11 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { Context } context - Indicates the application context. - * @param { string } uri - Indicates the path of the file to open. - * @param { AsyncCallback } callback - the dataShareHelper. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. + * @param {Context} context - Indicates the application context. + * @param {string} uri - Indicates the path of the file to open. + * @param {AsyncCallback} callback - {DataShareHelper}: the dataShareHelper for consumer. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -43,11 +43,11 @@ declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { Context } context - Indicates the application context. - * @param { string } uri - Indicates the path of the file to open. - * @returns { Promise } the dataShareHelper. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. + * @param {Context} context - Indicates the application context. + * @param {string} uri - Indicates the path of the file to open. + * @returns {Promise} {DataShareHelper}: the dataShareHelper for consumer. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -65,9 +65,9 @@ declare namespace dataShare { interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @param { string } type - must be 'dataChange'. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - Indicates the callback when dataChange. + * @param {string} type - type must be 'dataChange'. + * @param {string} uri - Indicates the path of the data to operate. + * @param {AsyncCallback} callback - the callback of on. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -77,9 +77,9 @@ declare namespace dataShare { /** * Deregisters an observer used for monitoring data specified by the given uri. - * @param { string } type - must be 'dataChange'. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - Indicates the callback when dataChange. + * @param {string} type - type must be 'dataChange'. + * @param {string} uri - Indicates the path of the data to operate. + * @param {AsyncCallback} callback - the callback of off. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -89,10 +89,11 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @param { AsyncCallback } callback - the index of the inserted data record. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {ValueBucket} value - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @param {AsyncCallback} callback - {number}: the index of the inserted data record. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -102,10 +103,11 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @returns { Promise } the index of the inserted data record. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {ValueBucket} value - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @returns {Promise} {number}: the index of the inserted data record. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -115,10 +117,11 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { AsyncCallback } callback - the number of data records deleted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {AsyncCallback} callback - {number}: the number of data records deleted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -128,10 +131,11 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @returns { Promise } the number of data records deleted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @returns {Promise} {number}: the number of data records deleted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -141,11 +145,13 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { AsyncCallback } callback - the query result. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to query. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {Array} columns - Indicates the columns to query. + * If this parameter is null, all columns are queried. + * @param {AsyncCallback} callback - {DataShareResultSet}: the query result. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -155,11 +161,13 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @returns { Promise } - the query result. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to query. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {Array} columns - Indicates the columns to query. + * If this parameter is null, all columns are queried. + * @returns {Promise} {DataShareResultSet}: the query result. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -169,11 +177,12 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. - * @param { AsyncCallback } callback - the number of data records updated. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to update. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {ValueBucket} value - Indicates the data to update. This parameter can be null. + * @param {AsyncCallback} callback - {number}: the number of data records updated. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -183,11 +192,12 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. - * @returns { Promise } the number of data records updated. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to update. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {ValueBucket} value - Indicates the data to update. This parameter can be null. + * @returns {Promise} {number}: the number of data records updated. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -197,10 +207,10 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { Array } values - Indicates the data records to insert. - * @param { AsyncCallback } callback - the number of data records inserted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {Array} values - Indicates the data records to insert. + * @param {AsyncCallback} callback - {number}: the number of data records inserted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -210,10 +220,10 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { Array } values - Indicates the data records to insert. - * @returns { Promise } the number of data records inserted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {Array} values - Indicates the data records to insert. + * @returns {Promise} {number}: the number of data records inserted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -227,8 +237,9 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @param { AsyncCallback } callback - the normalized Uri if the DataShare supports uri normalization; + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @param {AsyncCallback} callback - {string}: the normalized Uri, + * if the DataShare supports uri normalization. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -242,8 +253,8 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @returns { Promise } the normalized Uri if the DataShare supports uri normalization; + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @returns {Promise} {string}: the normalized Uri if the DataShare supports uri normalization; * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -253,10 +264,11 @@ declare namespace dataShare { /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @param { AsyncCallback } callback - the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @param {AsyncCallback} callback - {string}: the denormalized {@code Uri} object if + * the denormalization is successful; returns the original {@code Uri} passed to this method if + * there is nothing to do; returns {@code null} if the data identified by the normalized {@code Uri} + * cannot be found in the current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -266,10 +278,11 @@ declare namespace dataShare { /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @returns { Promise } the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @returns {Promise} {string}: the denormalized {@code Uri} object if the denormalization + * is successful; returns the original {@code Uri} passed to this method if there is nothing to do; + * returns {@code null} if the data identified by the normalized {@code Uri} cannot be found in the + * current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -279,8 +292,8 @@ declare namespace dataShare { /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @param { AsyncCallback } callback - callback. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @param {AsyncCallback} callback - the callback of notifyChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -290,8 +303,8 @@ declare namespace dataShare { /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @returns { Promise } the promise returned by the function. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @returns {Promise} the promise returned by the function. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly -- Gitee From 8629760f4778d63d225462811582fe7ec6f0a166 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 14:25:41 +0800 Subject: [PATCH 18/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index beba9e5e49..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 2aa05a18209a9226d7e47f980a30ea91e624a6e2 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 15:00:31 +0800 Subject: [PATCH 19/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 9 +++-- 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..f09822c371 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 0e9248525a..2a55be2efc 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -157,7 +157,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, + callback: AsyncCallback): void; /** * Queries data in the database. @@ -173,7 +174,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, + columns: Array): Promise; /** * Updates data records in the database. @@ -188,7 +190,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, + callback: AsyncCallback): void; /** * Updates data records in the database. -- Gitee From bc6e400affbb291795f9eefb2b503dc71a65168b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 15:00:41 +0800 Subject: [PATCH 20/20] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f09822c371..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee