From abed36997d9ffb720c3a9cf19eff4df0b979439d Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 03:58:46 +0800 Subject: [PATCH 1/7] =?UTF-8?q?UDMF=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?Signed-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 400 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 api/@ohos.data.UDMF.d.ts diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts new file mode 100644 index 0000000000..3814609171 --- /dev/null +++ b/api/@ohos.data.UDMF.d.ts @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * UDMF - Unified Data Management Framework + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @import import unifiedData from '@ohos.data.UDMF'; + */ +declare namespace UDMF { + enum Intention { + + } + + /** + * the data type supported by unified data + * @since 10 + */ + enum UnifiedDataType { + /** + * indicate the data type is text + * @since 10 + */ + TEXT = "Text", + /** + * indicate the data type is plain text + * @since 10 + */ + PLAIN_TEXT = "Text.PlainText", + /** + * indicate the data type is hyperlink + * @since 10 + */ + HYPER_LINK = "Text.HyperLink", + /** + * indicate the data type is html + * @since 10 + */ + HTML = "Text.HTML", + /** + * indicate the data type is File + * @since 10 + */ + FILE = "File", + /** + * indicate the data type is image + * @since 10 + */ + IMAGE = "File.Media.Image", + /** + * indicate the data type is video + * @since 10 + */ + VIDEO = "File.Media.Video", + /** + * indicate the data type is Folder + * @since 10 + */ + FOLDER = "File.Folder", + /** + * indicate the data type is system defined record(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + SYSTEM_DEFINED_RECORD = "SystemDefinedType", + /** + * indicate the data type is system defined form(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + SYSTEM_DEFINED_FORM = "SystemDefinedType.Form", + /** + * indicate the data type is system defined app item(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + SYSTEM_DEFINED_APP_ITEM = "SystemDefinedType.AppItem", + /** + * indicate the data type is system defined pixel map(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap", + /** + * indicate the data type is application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + APPLICATION_DEFINED_RECORD = "ApplicationDefinedType", + } + + type UnifiedKey = string; + + /** + * describe the unified data, which can at most contains 512 unified data records, and its maximum memory is 512M. + * @since 10 + */ + class UnifiedData { + /** + * create unified data with a record + * @param {UnifiedRecord} record - Record will add into unified data. + * @throws {BusinessError} 401 - Parameter error. + * @since 10 + */ + constructor(record: UnifiedRecord); + /** + * add a record into unified data + * @param {UnifiedRecord} record - Record will add into unified data. + * @throws {BusinessError} 401 - Parameter error. + * @since 10 + */ + addRecord(record: UnifiedRecord): void; + /** + * get all records of unified data + * @return the records of unified data + * @since 10 + */ + getRecords(): Array; + } + + class Option { + intention: Intention; + key: UnifiedKey; + } + + /** + * the data abstract supported by unified data + * @since 10 + */ + class Summary { + /** + * a map for each type and data size, key is data type, value is the corresponding data size + * @since 10 + */ + summary: { [key: string]: number }; + /** + * total data size of data in Bytes + * @since 10 + */ + totalSize: number; + } + + /** + * describe the unified record + * @since 10 + */ + class UnifiedRecord { + /** + * get type of unified record + * @return the type of unified data + * @since 10 + */ + getType(): string; + } + + /** + * describe the unified text data + * @since 10 + */ + class Text extends UnifiedRecord { + /** + * indicates the details of unified text + * @since 10 + */ + details?: { [key: string]: string }; + } + + /** + * describe the unified plain text data + * @since 10 + */ + class PlainText extends Text { + /** + * indicates the content of text + * @since 10 + */ + textContent: string; + /** + * indicates the abstract of text + * @since 10 + */ + abstract?: string; + } + + /** + * describe the unified link data + * @since 10 + */ + class HyperLink extends Text { + /** + * indicates the url of a link + * @since 10 + */ + url: string; + /** + * indicates the description of a link + * @since 10 + */ + description?: string; + } + + /** + * describe the unified html data + * @since 10 + */ + class HTML extends Text { + /** + * indicates the content of html, with html tags + * @since 10 + */ + htmlContent: string; + /** + * indicates the plain content of html + * @since 10 + */ + plainContent?: string; + } + + /** + * describe the unified file data + * @since 10 + */ + class File extends UnifiedRecord { + /** + * indicates the details of unified File + * @since 10 + */ + details?: { [key: string]: string }; + /** + * indicates the uri of file + * @since 10 + */ + uri: string; + } + + /** + * describe the unified image data + * @since 10 + */ + class Image extends File { + /** + * indicates the uri of image + * @since 10 + */ + imageUri: string; + } + + /** + * describe the unified video data + * @since 10 + */ + class Video extends File { + /** + * indicates the uri of video + * @since 10 + */ + videoUri: string; + } + + /** + * describe the unified folder data + * @since 10 + */ + class Folder extends File { + /** + * indicates the uri of folder + * @since 10 + */ + uri: string; + } + + /** + * describe system defined type data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class SystemDefinedRecord extends UnifiedRecord { + /** + * indicates the details of system defined data + * @since 10 + */ + details?: { [key: string]: number | string | Uint8Array }; + } + + /** + * describe system defined form data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class SystemDefinedForm extends SystemDefinedRecord { + /** + * indicates the id of form + * @since 10 + */ + formId: number; + /** + * indicates the name of form + * @since 10 + */ + formName: string; + /** + * indicates the bundle name of form + * @since 10 + */ + bundleName: string; + /** + * indicates the ability name of form + * @since 10 + */ + abilityName: string; + /** + * indicates the module of form + * @since 10 + */ + module: string; + } + + /** + * describe system defined app item data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class SystemDefinedAppItem extends SystemDefinedRecord { + /** + * indicates the app id + * @since 10 + */ + appId: string; + /** + * indicates the app name + * @since 10 + */ + appName: string; + /** + * indicates the id of app icon + * @since 10 + */ + appIconId: string; + /** + * indicates the id of app label + * @since 10 + */ + appLabelId: string; + /** + * indicates the bundle name of app + * @since 10 + */ + bundleName: string; + /** + * indicates the ability name of app + * @since 10 + */ + abilityName: string; + } + + /** + * describe system defined pixel map data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class SystemDefinedPixelMap extends SystemDefinedRecord { + /** + * indicates the raw data of pixel map + * @since 10 + */ + rawData: Uint8Array; + } + + /** + * describe application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class ApplicationDefinedRecord extends UnifiedRecord { + /** + * indicates the type of data, should always be started with 'ApplicationDefined.', will + * return error otherwise + * @since 10 + */ + applicationDefinedType: string; + /** + * indicates the raw data of application defined data + * @since 10 + */ + rawData: Uint8Array; + } +} + +export default UDMF; \ No newline at end of file -- Gitee From 1fd79008d5b7d25ff65cec2f73f23892d4eac982 Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 12:07:21 +0800 Subject: [PATCH 2/7] =?UTF-8?q?UDMF=E8=AF=84=E5=AE=A1=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20Signed-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 64 ++-------------------------------------- 1 file changed, 3 insertions(+), 61 deletions(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index 3814609171..0e12121e67 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -19,10 +19,6 @@ * @import import unifiedData from '@ohos.data.UDMF'; */ declare namespace UDMF { - enum Intention { - - } - /** * the data type supported by unified data * @since 10 @@ -91,13 +87,7 @@ declare namespace UDMF { * also can be parsed by system provided API) * @since 10 */ - SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap", - /** - * indicate the data type is application defined data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - APPLICATION_DEFINED_RECORD = "ApplicationDefinedType", + SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap" } type UnifiedKey = string; @@ -227,28 +217,11 @@ declare namespace UDMF { plainContent?: string; } - /** - * describe the unified file data - * @since 10 - */ - class File extends UnifiedRecord { - /** - * indicates the details of unified File - * @since 10 - */ - details?: { [key: string]: string }; - /** - * indicates the uri of file - * @since 10 - */ - uri: string; - } - /** * describe the unified image data * @since 10 */ - class Image extends File { + class Image extends UnifiedRecord { /** * indicates the uri of image * @since 10 @@ -260,7 +233,7 @@ declare namespace UDMF { * describe the unified video data * @since 10 */ - class Video extends File { + class Video extends UnifiedRecord { /** * indicates the uri of video * @since 10 @@ -268,18 +241,6 @@ declare namespace UDMF { videoUri: string; } - /** - * describe the unified folder data - * @since 10 - */ - class Folder extends File { - /** - * indicates the uri of folder - * @since 10 - */ - uri: string; - } - /** * describe system defined type data(this kind of data is provided and bound to OpenHarmony, * also can be parsed by system provided API) @@ -376,25 +337,6 @@ declare namespace UDMF { */ rawData: Uint8Array; } - - /** - * describe application defined data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - class ApplicationDefinedRecord extends UnifiedRecord { - /** - * indicates the type of data, should always be started with 'ApplicationDefined.', will - * return error otherwise - * @since 10 - */ - applicationDefinedType: string; - /** - * indicates the raw data of application defined data - * @since 10 - */ - rawData: Uint8Array; - } } export default UDMF; \ No newline at end of file -- Gitee From b6335659c2a7d0aab2e1df1469754b1f1a58a27f Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 12:08:56 +0800 Subject: [PATCH 3/7] =?UTF-8?q?UDMF=E5=A4=96=E5=8F=91=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?Signed-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index 0e12121e67..dfff067295 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -90,8 +90,6 @@ declare namespace UDMF { SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap" } - type UnifiedKey = string; - /** * describe the unified data, which can at most contains 512 unified data records, and its maximum memory is 512M. * @since 10 -- Gitee From 5d3dc17673a2ccaf5e26dee7d1a7100f5eae9b07 Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 15:02:16 +0800 Subject: [PATCH 4/7] =?UTF-8?q?UDMF=E6=96=B0=E5=A2=9Eapi=20Signed-off-by:?= =?UTF-8?q?=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 65 +++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index dfff067295..48ef2e1203 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -87,7 +87,13 @@ declare namespace UDMF { * also can be parsed by system provided API) * @since 10 */ - SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap" + SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap", + /** + * indicate the data type is application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + APPLICATION_DEFINED_RECORD = "ApplicationDefinedType", } /** @@ -117,11 +123,6 @@ declare namespace UDMF { getRecords(): Array; } - class Option { - intention: Intention; - key: UnifiedKey; - } - /** * the data abstract supported by unified data * @since 10 @@ -215,11 +216,28 @@ declare namespace UDMF { plainContent?: string; } + /** + * describe the unified file data + * @since 10 + */ + class File extends UnifiedRecord { + /** + * indicates the details of unified File + * @since 10 + */ + details?: { [key: string]: string }; + /** + * indicates the uri of file + * @since 10 + */ + uri: string; + } + /** * describe the unified image data * @since 10 */ - class Image extends UnifiedRecord { + class Image extends File { /** * indicates the uri of image * @since 10 @@ -231,7 +249,7 @@ declare namespace UDMF { * describe the unified video data * @since 10 */ - class Video extends UnifiedRecord { + class Video extends File { /** * indicates the uri of video * @since 10 @@ -239,6 +257,18 @@ declare namespace UDMF { videoUri: string; } + /** + * describe the unified folder data + * @since 10 + */ + class Folder extends File { + /** + * indicates the uri of folder + * @since 10 + */ + uri: string; + } + /** * describe system defined type data(this kind of data is provided and bound to OpenHarmony, * also can be parsed by system provided API) @@ -335,6 +365,25 @@ declare namespace UDMF { */ rawData: Uint8Array; } + + /** + * describe application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * @since 10 + */ + class ApplicationDefinedRecord extends UnifiedRecord { + /** + * indicates the type of data, should always be started with 'ApplicationDefined.', will + * return error otherwise + * @since 10 + */ + applicationDefinedType: string; + /** + * indicates the raw data of application defined data + * @since 10 + */ + rawData: Uint8Array; + } } export default UDMF; \ No newline at end of file -- Gitee From 0a9372508e1e13581b3d8a37db6e5005796afdc1 Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 16:37:49 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9.d.ts=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=20Signed-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 686 +++++++++++++++++++++------------------ 1 file changed, 370 insertions(+), 316 deletions(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index 48ef2e1203..9362d3f7eb 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -15,375 +15,429 @@ /** * UDMF - Unified Data Management Framework + * + * @namespace UDMF * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @import import unifiedData from '@ohos.data.UDMF'; */ declare namespace UDMF { + /** + * the data type supported by unified data + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + enum UnifiedDataType { /** - * the data type supported by unified data - * @since 10 - */ - enum UnifiedDataType { - /** - * indicate the data type is text - * @since 10 - */ - TEXT = "Text", - /** - * indicate the data type is plain text - * @since 10 - */ - PLAIN_TEXT = "Text.PlainText", - /** - * indicate the data type is hyperlink - * @since 10 - */ - HYPER_LINK = "Text.HyperLink", - /** - * indicate the data type is html - * @since 10 - */ - HTML = "Text.HTML", - /** - * indicate the data type is File - * @since 10 - */ - FILE = "File", - /** - * indicate the data type is image - * @since 10 - */ - IMAGE = "File.Media.Image", - /** - * indicate the data type is video - * @since 10 - */ - VIDEO = "File.Media.Video", - /** - * indicate the data type is Folder - * @since 10 - */ - FOLDER = "File.Folder", - /** - * indicate the data type is system defined record(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - SYSTEM_DEFINED_RECORD = "SystemDefinedType", - /** - * indicate the data type is system defined form(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - SYSTEM_DEFINED_FORM = "SystemDefinedType.Form", - /** - * indicate the data type is system defined app item(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - SYSTEM_DEFINED_APP_ITEM = "SystemDefinedType.AppItem", - /** - * indicate the data type is system defined pixel map(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - SYSTEM_DEFINED_PIXEL_MAP = "SystemDefinedType.PixelMap", - /** - * indicate the data type is application defined data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) - * @since 10 - */ - APPLICATION_DEFINED_RECORD = "ApplicationDefinedType", - } - + * indicate the data type is text + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + TEXT = 'Text', /** - * describe the unified data, which can at most contains 512 unified data records, and its maximum memory is 512M. - * @since 10 - */ - class UnifiedData { - /** - * create unified data with a record - * @param {UnifiedRecord} record - Record will add into unified data. - * @throws {BusinessError} 401 - Parameter error. - * @since 10 - */ - constructor(record: UnifiedRecord); - /** - * add a record into unified data - * @param {UnifiedRecord} record - Record will add into unified data. - * @throws {BusinessError} 401 - Parameter error. - * @since 10 - */ - addRecord(record: UnifiedRecord): void; - /** - * get all records of unified data - * @return the records of unified data - * @since 10 - */ - getRecords(): Array; - } - + * indicate the data type is plain text + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + PLAIN_TEXT = 'Text.PlainText', /** - * the data abstract supported by unified data - * @since 10 - */ - class Summary { - /** - * a map for each type and data size, key is data type, value is the corresponding data size - * @since 10 - */ - summary: { [key: string]: number }; - /** - * total data size of data in Bytes - * @since 10 - */ - totalSize: number; - } - + * indicate the data type is hyperlink + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + HYPER_LINK = 'Text.HyperLink', /** - * describe the unified record + * indicate the data type is html + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class UnifiedRecord { - /** - * get type of unified record - * @return the type of unified data - * @since 10 - */ - getType(): string; - } + HTML = 'Text.HTML', + /** + * indicate the data type is image + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + IMAGE = 'File.Media.Image', + /** + * indicate the data type is video + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + VIDEO = 'File.Media.Video', + /** + * indicate the data type is system defined record(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + SYSTEM_DEFINED_RECORD = 'SystemDefinedType', + /** + * indicate the data type is system defined form(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + SYSTEM_DEFINED_FORM = 'SystemDefinedType.Form', + /** + * indicate the data type is system defined app item(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + SYSTEM_DEFINED_APP_ITEM = 'SystemDefinedType.AppItem', + /** + * indicate the data type is system defined pixel map(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + SYSTEM_DEFINED_PIXEL_MAP = 'SystemDefinedType.PixelMap', + } + /** + * describe the unified data, which can at most contains 512 unified data records, and its maximum memory is 512M. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class UnifiedData { + /** + * create unified data with a record + * + * @param { UnifiedRecord } record - Record will add into unified data. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + constructor(record: UnifiedRecord); + /** + * add a record into unified data + * + * @param { UnifiedRecord } record - Record will add into unified data. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + addRecord(record: UnifiedRecord): void; /** - * describe the unified text data + * get all records of unified data + * + * @returns { Array } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 + * @return the records of unified data */ - class Text extends UnifiedRecord { - /** - * indicates the details of unified text - * @since 10 - */ - details?: { [key: string]: string }; - } + getRecords(): Array; + } + /** + * the data abstract supported by unified data + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class Summary { /** - * describe the unified plain text data - * @since 10 - */ - class PlainText extends Text { - /** - * indicates the content of text - * @since 10 - */ - textContent: string; - /** - * indicates the abstract of text - * @since 10 - */ - abstract?: string; - } + * a map for each type and data size, key is data type, value is the corresponding data size + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + summary: { [key: string]: number }; + /** + * total data size of data in Bytes + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + totalSize: number; + } + /** + * describe the unified record + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class UnifiedRecord { /** - * describe the unified link data - * @since 10 - */ - class HyperLink extends Text { - /** - * indicates the url of a link - * @since 10 - */ - url: string; - /** - * indicates the description of a link - * @since 10 - */ - description?: string; - } + * get type of unified record + * + * @returns { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + * @return the type of unified data + */ + getType(): string; + } + /** + * describe the unified text data + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class Text extends UnifiedRecord { /** - * describe the unified html data - * @since 10 - */ - class HTML extends Text { - /** - * indicates the content of html, with html tags - * @since 10 - */ - htmlContent: string; - /** - * indicates the plain content of html - * @since 10 - */ - plainContent?: string; - } + * indicates the details of unified text + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + details?: { [key: string]: string }; + } + /** + * describe the unified plain text data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class PlainText extends Text { + /** + * indicates the content of text + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + textContent: string; /** - * describe the unified file data - * @since 10 - */ - class File extends UnifiedRecord { - /** - * indicates the details of unified File - * @since 10 - */ - details?: { [key: string]: string }; - /** - * indicates the uri of file - * @since 10 - */ - uri: string; - } + * indicates the abstract of text + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + abstract?: string; + } + /** + * describe the unified link data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class HyperLink extends Text { + /** + * indicates the url of a link + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + url: string; /** - * describe the unified image data + * indicates the description of a link + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class Image extends File { - /** - * indicates the uri of image - * @since 10 - */ - imageUri: string; - } + description?: string; + } + /** + * describe the unified html data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class HTML extends Text { /** - * describe the unified video data + * indicates the content of html, with html tags + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class Video extends File { - /** - * indicates the uri of video - * @since 10 - */ - videoUri: string; - } + htmlContent: string; + /** + * indicates the plain content of html + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + plainContent?: string; + } + /** + * describe the unified image data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class Image extends UnifiedRecord { /** - * describe the unified folder data + * indicates the uri of image + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class Folder extends File { - /** - * indicates the uri of folder - * @since 10 - */ - uri: string; - } + imageUri: string; + } + /** + * describe the unified video data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class Video extends UnifiedRecord { /** - * describe system defined type data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) + * indicates the uri of video + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class SystemDefinedRecord extends UnifiedRecord { - /** - * indicates the details of system defined data - * @since 10 - */ - details?: { [key: string]: number | string | Uint8Array }; - } + videoUri: string; + } + /** + * describe system defined type data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class SystemDefinedRecord extends UnifiedRecord { /** - * describe system defined form data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) + * indicates the details of system defined data + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class SystemDefinedForm extends SystemDefinedRecord { - /** - * indicates the id of form - * @since 10 - */ - formId: number; - /** - * indicates the name of form - * @since 10 - */ - formName: string; - /** - * indicates the bundle name of form - * @since 10 - */ - bundleName: string; - /** - * indicates the ability name of form - * @since 10 - */ - abilityName: string; - /** - * indicates the module of form - * @since 10 - */ - module: string; - } + details?: { [key: string]: number | string | Uint8Array }; + } + /** + * describe system defined form data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @extends SystemDefinedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class SystemDefinedForm extends SystemDefinedRecord { /** - * describe system defined app item data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) + * indicates the id of form + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class SystemDefinedAppItem extends SystemDefinedRecord { - /** - * indicates the app id - * @since 10 - */ - appId: string; - /** - * indicates the app name - * @since 10 - */ - appName: string; - /** - * indicates the id of app icon - * @since 10 - */ - appIconId: string; - /** - * indicates the id of app label - * @since 10 - */ - appLabelId: string; - /** - * indicates the bundle name of app - * @since 10 - */ - bundleName: string; - /** - * indicates the ability name of app - * @since 10 - */ - abilityName: string; - } + formId: number; + /** + * indicates the name of form + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + formName: string; + /** + * indicates the bundle name of form + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + bundleName: string; + /** + * indicates the ability name of form + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + abilityName: string; + /** + * indicates the module of form + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + module: string; + } + /** + * describe system defined app item data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @extends SystemDefinedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class SystemDefinedAppItem extends SystemDefinedRecord { /** - * describe system defined pixel map data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) + * indicates the app id + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + appId: string; + /** + * indicates the app name + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + appName: string; + /** + * indicates the id of app icon + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + appIconId: string; + /** + * indicates the id of app label + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class SystemDefinedPixelMap extends SystemDefinedRecord { - /** - * indicates the raw data of pixel map - * @since 10 - */ - rawData: Uint8Array; - } + appLabelId: string; + /** + * indicates the bundle name of app + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + bundleName: string; + /** + * indicates the ability name of app + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + abilityName: string; + } + /** + * describe system defined pixel map data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @extends SystemDefinedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class SystemDefinedPixelMap extends SystemDefinedRecord { /** - * describe application defined data(this kind of data is provided and bound to OpenHarmony, - * also can be parsed by system provided API) + * indicates the raw data of pixel map + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class ApplicationDefinedRecord extends UnifiedRecord { - /** - * indicates the type of data, should always be started with 'ApplicationDefined.', will - * return error otherwise - * @since 10 - */ - applicationDefinedType: string; - /** - * indicates the raw data of application defined data - * @since 10 - */ - rawData: Uint8Array; - } + rawData: Uint8Array; + } } -export default UDMF; \ No newline at end of file +export default UDMF; -- Gitee From 14d04dd3db7f335fd2147cbf8d8ab58179228442 Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 17:08:14 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9hyperlink=20Signed-off-by?= =?UTF-8?q?:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index 9362d3f7eb..2bd1e72d4f 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -48,7 +48,7 @@ declare namespace UDMF { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - HYPER_LINK = 'Text.HyperLink', + HYPERLINK = 'Text.HyperLink', /** * indicate the data type is html * -- Gitee From cd4f7b8aeabcc2ad2fad5b059c55c577355ef70c Mon Sep 17 00:00:00 2001 From: anqi Date: Fri, 12 May 2023 17:14:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E4=B8=93=E5=AE=B6=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9=20Signed?= =?UTF-8?q?-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.UDMF.d.ts | 104 +++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/api/@ohos.data.UDMF.d.ts b/api/@ohos.data.UDMF.d.ts index 2bd1e72d4f..95bc32f2fd 100644 --- a/api/@ohos.data.UDMF.d.ts +++ b/api/@ohos.data.UDMF.d.ts @@ -18,7 +18,6 @@ * * @namespace UDMF * @syscap SystemCapability.DistributedDataManager.UDMF.Core - * @import import unifiedData from '@ohos.data.UDMF'; */ declare namespace UDMF { /** @@ -48,7 +47,7 @@ declare namespace UDMF { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - HYPERLINK = 'Text.HyperLink', + HYPERLINK = 'Text.Hyperlink', /** * indicate the data type is html * @@ -56,6 +55,13 @@ declare namespace UDMF { * @since 10 */ HTML = 'Text.HTML', + /** + * indicate the data type is File + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + FILE = 'File', /** * indicate the data type is image * @@ -70,6 +76,13 @@ declare namespace UDMF { * @since 10 */ VIDEO = 'File.Media.Video', + /** + * indicate the data type is Folder + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + FOLDER = 'File.Folder', /** * indicate the data type is system defined record(this kind of data is provided and bound to OpenHarmony, * also can be parsed by system provided API) @@ -102,6 +115,14 @@ declare namespace UDMF { * @since 10 */ SYSTEM_DEFINED_PIXEL_MAP = 'SystemDefinedType.PixelMap', + /** + * indicate the data type is application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + APPLICATION_DEFINED_RECORD = 'ApplicationDefinedType' } /** @@ -132,10 +153,9 @@ declare namespace UDMF { /** * get all records of unified data * - * @returns { Array } + * @returns { Array } Return the records of unified data * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 - * @return the records of unified data */ getRecords(): Array; } @@ -173,10 +193,9 @@ declare namespace UDMF { /** * get type of unified record * - * @returns { string } + * @returns { string } Return the type of unified data * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 - * @return the type of unified data */ getType(): string; } @@ -229,7 +248,7 @@ declare namespace UDMF { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class HyperLink extends Text { + class Hyperlink extends Text { /** * indicates the url of a link * @@ -270,6 +289,30 @@ declare namespace UDMF { plainContent?: string; } + /** + * describe the unified file data + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class File extends UnifiedRecord { + /** + * indicates the details of unified File + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + details?: { [key: string]: string }; + /** + * indicates the uri of file + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + uri: string; + } + /** * describe the unified image data * @@ -277,7 +320,7 @@ declare namespace UDMF { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class Image extends UnifiedRecord { + class Image extends File { /** * indicates the uri of image * @@ -294,7 +337,7 @@ declare namespace UDMF { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @since 10 */ - class Video extends UnifiedRecord { + class Video extends File { /** * indicates the uri of video * @@ -304,6 +347,23 @@ declare namespace UDMF { videoUri: string; } + /** + * describe the unified folder data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class Folder extends File { + /** + * indicates the uri of folder + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + folderUri: string; + } + /** * describe system defined type data(this kind of data is provided and bound to OpenHarmony, * also can be parsed by system provided API) @@ -438,6 +498,32 @@ declare namespace UDMF { */ rawData: Uint8Array; } + + /** + * describe application defined data(this kind of data is provided and bound to OpenHarmony, + * also can be parsed by system provided API) + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + class ApplicationDefinedRecord extends UnifiedRecord { + /** + * indicates the type of data, should always be started with 'ApplicationDefined.', will + * return error otherwise + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + applicationDefinedType: string; + /** + * indicates the raw data of application defined data + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @since 10 + */ + rawData: Uint8Array; + } } export default UDMF; -- Gitee