From a3c972ed09f95aa03fc485c5ece71bcce4aa3bd2 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Thu, 28 Jul 2022 10:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4openFile=E3=80=81getType?= =?UTF-8?q?=E3=80=81getFileTypes=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: duanweiling --- ...application.DataShareExtensionAbility.d.ts | 48 ------------------- api/@ohos.data.dataShare.d.ts | 43 ----------------- 2 files changed, 91 deletions(-) diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts index 4ce490fdb0..c56abbdeb8 100644 --- a/api/@ohos.application.DataShareExtensionAbility.d.ts +++ b/api/@ohos.application.DataShareExtensionAbility.d.ts @@ -50,39 +50,6 @@ export default class DataShareExtensionAbility { */ onCreate?(want: Want, callback: AsyncCallback): void; - /** - * Obtains the MIME type of files. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the path of the files to obtain. - * @param mimeTypeFilter Indicates the MIME type of the files to obtain. This parameter cannot be set to {@code - * null}. - *

1. "*/*": Obtains all types supported by a data share. - *

2. "image/*": Obtains files whose main type is image of any subtype. - *

3. "*/jpg": Obtains files whose subtype is JPG of any main type. - * @systemapi Hide this for inner system use. - * @return Returns the MIME type of the matched files; returns null if there is no type that matches the Data - * @StageModelOnly - */ - getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; - - /** - * Opens a file in a specified remote path. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the path of the file to open. - * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access - * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing - * file, "wa" for write-only access to append to any existing data, "rw" for read and write access on - * any existing data, or "rwt" for read and write access that truncates any existing file. - * @param callback Indicates the callback when openfile success - * @return Returns the file descriptor. - * @StageModelOnly - */ - openFile?(uri: string, mode: string, callback: AsyncCallback): void; - /** * Inserts a data record into the database. This method should be implemented by a data share. * @@ -144,21 +111,6 @@ export default class DataShareExtensionAbility { query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - /** - * Obtains the MIME type matching the data specified by the URI of the data share. This method should be - * implemented by a data share. - * - *

Data abilities supports general data types, including text, HTML, and JPEG.

- * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the uri of the data. - * @systemapi Hide this for inner system use. - * @return Returns the MIME type that matches the data specified by {@code uri}. - * @StageModelOnly - */ - getType?(uri: string, callback: AsyncCallback): void; - /** * Inserts multiple data records into the database. This method should be implemented by a data share. * diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index c86bad0c3a..3d8a6d49aa 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -38,23 +38,6 @@ declare namespace dataShare { * @StageModelOnly */ interface DataShareHelper { - /** - * Opens a file in a specified remote path. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the file to open. - * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access - * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing - * file, "wa" for write-only access to append to any existing data, "rw" for read and write access on - * any existing data, or "rwt" for read and write access that truncates any existing file. - * @param callback Indicates the callback when openfile success - * @return Returns the file descriptor. - * @StageModelOnly - */ - openFile(uri: string, mode: string, callback: AsyncCallback): void; - openFile(uri: string, mode: string): Promise; - /** * Registers an observer to observe data specified by the given uri. * @since 9 @@ -141,32 +124,6 @@ declare namespace dataShare { batchInsert(uri: string, values: Array, callback: AsyncCallback): void; batchInsert(uri: string, values: Array): Promise; - /** - * Obtains the MIME type of the date specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the data to operate. - * @return Returns the MIME type that matches the data specified by uri. - * @StageModelOnly - */ - getType(uri: string, callback: AsyncCallback): void; - getType(uri: string): Promise; - - /** - * Obtains the MIME types of files supported. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the files to obtain. - * @param mimeTypeFilter Indicates the MIME types of the files to obtain. This parameter cannot be null. - *

1. "*/*": Obtains all types supported by Data abilities. - *

2. "image/*": Obtains files whose main type is image of any subtype. - *

3. "*/jpg": Obtains files whose subtype is JPG of any main type. - * @return Returns the matched MIME types. If there is no match, {@code null} is returned. - * @StageModelOnly - */ - getFileTypes(uri: string, mimeTypeFilter:string, callback: AsyncCallback>): void; - getFileTypes(uri: string, mimeTypeFilter: string): 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. -- Gitee