• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkData
19 */
20
21/**
22 * Provide uniform data struct definition.
23 *
24 * @namespace uniformDataStruct
25 * @syscap SystemCapability.DistributedDataManager.UDMF.Core
26 * @since 12
27 */
28declare namespace uniformDataStruct {
29  /**
30   * Describe the plain text uniform data struct.
31   *
32   * @interface PlainText
33   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
34   * @since 12
35   */
36  interface PlainText {
37    /**
38     * Indicates the uniform data type of this data struct.
39     *
40     * @type { 'general.plain-text' }
41     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
42     * @since 12
43     */
44    uniformDataType: 'general.plain-text';
45    /**
46     * Indicates the content of the PlainText.
47     *
48     * @type { string }
49     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
50     * @since 12
51     */
52    textContent: string;
53
54    /**
55     * Indicates the abstract of the PlainText.
56     * @type { ?string }
57     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
58     * @since 12
59     */
60    abstract?: string;
61    /**
62     * Indicates the details of the PlainText.
63     *
64     * @type { ?Record<string, string> }
65     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
66     * @since 12
67     */
68     details?: Record<string, string>;
69  }
70
71  /**
72   * Describe the hyperlink uniform data struct.
73   *
74   * @interface Hyperlink
75   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
76   * @since 12
77   */
78  interface Hyperlink {
79    /**
80     * Indicates the uniform data type of this data struct.
81     *
82     * @type { 'general.hyperlink' }
83     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
84     * @since 12
85     */
86    uniformDataType: 'general.hyperlink';
87    /**
88     * Indicates the url of of the Hyperlink.
89     *
90     * @type { string }
91     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
92     * @since 12
93     */
94    url: string;
95    /**
96     * Indicates the description of the Hyperlink.
97     * @type { ?string }
98     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
99     * @since 12
100     */
101    description?: string;
102    /**
103     * Indicates the details of the Hyperlink.
104     *
105     * @type { ?Record<string, string> }
106     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
107     * @since 12
108     */
109     details?: Record<string, string>;
110  }
111
112  /**
113   * Describe the html uniform data struct.
114   *
115   * @interface HTML
116   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
117   * @since 12
118   */
119  interface HTML {
120    /**
121     * Indicates the uniform data type of this data struct.
122     *
123     * @type { 'general.html' }
124     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
125     * @since 12
126     */
127    uniformDataType: 'general.html';
128
129    /**
130     * Indicates the content of html, with html tags.
131     *
132     * @type { string }
133     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
134     * @since 12
135     */
136    htmlContent: string;
137    /**
138     * Indicates the plain content of html.
139     *
140     * @type { ?string }
141     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
142     * @since 12
143     */
144    plainContent?: string;
145    /**
146     * Indicates the details of html.
147     *
148     * @type { ?Record<string, string> }
149     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
150     * @since 12
151     */
152     details?: Record<string, string>;
153  }
154
155  /**
156   * Describe system defined app item uniform data struct(this kind of struct is provided and bound to OpenHarmony).
157   *
158   * @interface OpenHarmonyAppItem
159   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
160   * @since 12
161   */
162  interface OpenHarmonyAppItem {
163    /**
164     * Indicates the uniform data type of this data struct.
165     *
166     * @type { 'openharmony.app-item' }
167     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
168     * @since 12
169     */
170    uniformDataType: 'openharmony.app-item';
171    /**
172     * Indicates the app id.
173     *
174     * @type { string }
175     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
176     * @since 12
177     */
178    appId: string;
179    /**
180     * Indicates the app name.
181     *
182     * @type { string }
183     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
184     * @since 12
185     */
186    appName: string;
187    /**
188     * Indicates the id of app icon.
189     *
190     * @type { string }
191     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
192     * @since 12
193     */
194    appIconId: string;
195    /**
196     * Indicates the id of app label.
197     *
198     * @type { string }
199     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
200     * @since 12
201     */
202    appLabelId: string;
203    /**
204     * Indicates the bundle name of app.
205     *
206     * @type { string }
207     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
208     * @since 12
209     */
210    bundleName: string;
211    /**
212     * Indicates the ability name of app.
213     *
214     * @type { string }
215     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
216     * @since 12
217     */
218    abilityName: string;
219    /**
220     * Indicates the details of app.
221     *
222     * @type { ?Record<string, number | string | Uint8Array> }
223     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
224     * @since 12
225     */
226     details?: Record<string, number | string | Uint8Array>;
227  }
228}
229
230export default uniformDataStruct;