• 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     * @readonly
42     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
43     * @since 12
44     */
45    readonly uniformDataType: 'general.plain-text';
46    /**
47     * Indicates the content of the PlainText.
48     *
49     * @type { string }
50     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
51     * @since 12
52     */
53    textContent: string;
54
55    /**
56     * Indicates the abstract of the PlainText.
57     * @type { ?string }
58     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
59     * @since 12
60     */
61    abstract?: string;
62    /**
63     * Indicates the details of the PlainText.
64     *
65     * @type { ?Record<string, string> }
66     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
67     * @since 12
68     */
69     details?: Record<string, string>;
70  }
71
72  /**
73   * Describe the hyperlink uniform data struct.
74   *
75   * @interface Hyperlink
76   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
77   * @since 12
78   */
79  interface Hyperlink {
80    /**
81     * Indicates the uniform data type of this data struct.
82     *
83     * @type { 'general.hyperlink' }
84     * @readonly
85     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
86     * @since 12
87     */
88    readonly uniformDataType: 'general.hyperlink';
89    /**
90     * Indicates the url of of the Hyperlink.
91     *
92     * @type { string }
93     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
94     * @since 12
95     */
96    url: string;
97    /**
98     * Indicates the description of the Hyperlink.
99     * @type { ?string }
100     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
101     * @since 12
102     */
103    description?: string;
104    /**
105     * Indicates the details of the Hyperlink.
106     *
107     * @type { ?Record<string, string> }
108     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
109     * @since 12
110     */
111     details?: Record<string, string>;
112  }
113
114  /**
115   * Describe the html uniform data struct.
116   *
117   * @interface HTML
118   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
119   * @since 12
120   */
121  interface HTML {
122    /**
123     * Indicates the uniform data type of this data struct.
124     *
125     * @type { 'general.html' }
126     * @readonly
127     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
128     * @since 12
129     */
130    readonly uniformDataType: 'general.html';
131
132    /**
133     * Indicates the content of html, with html tags.
134     *
135     * @type { string }
136     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
137     * @since 12
138     */
139    htmlContent: string;
140    /**
141     * Indicates the plain content of html.
142     *
143     * @type { ?string }
144     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
145     * @since 12
146     */
147    plainContent?: string;
148    /**
149     * Indicates the details of html.
150     *
151     * @type { ?Record<string, string> }
152     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
153     * @since 12
154     */
155     details?: Record<string, string>;
156  }
157
158  /**
159   * Describe system defined app item uniform data struct(this kind of struct is provided and bound to OpenHarmony).
160   *
161   * @interface OpenHarmonyAppItem
162   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
163   * @since 12
164   */
165  interface OpenHarmonyAppItem {
166    /**
167     * Indicates the uniform data type of this data struct.
168     *
169     * @type { 'openharmony.app-item' }
170     * @readonly
171     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
172     * @since 12
173     */
174    readonly uniformDataType: 'openharmony.app-item';
175    /**
176     * Indicates the app id.
177     *
178     * @type { string }
179     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
180     * @since 12
181     */
182    appId: string;
183    /**
184     * Indicates the app name.
185     *
186     * @type { string }
187     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
188     * @since 12
189     */
190    appName: string;
191    /**
192     * Indicates the id of app icon.
193     *
194     * @type { string }
195     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
196     * @since 12
197     */
198    appIconId: string;
199    /**
200     * Indicates the id of app label.
201     *
202     * @type { string }
203     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
204     * @since 12
205     */
206    appLabelId: string;
207    /**
208     * Indicates the bundle name of app.
209     *
210     * @type { string }
211     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
212     * @since 12
213     */
214    bundleName: string;
215    /**
216     * Indicates the ability name of app.
217     *
218     * @type { string }
219     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
220     * @since 12
221     */
222    abilityName: string;
223    /**
224     * Indicates the details of app.
225     *
226     * @type { ?Record<string, number | string | Uint8Array> }
227     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
228     * @since 12
229     */
230    details?: Record<string, number | string | Uint8Array>;
231  }
232
233  /**
234   * Describe content form uniform data struct.
235   *
236   * @interface ContentForm
237   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
238   * @since 14
239   */
240  interface ContentForm {
241    /**
242     * Indicates the uniform data type of this data struct.
243     *
244     * @type { 'general.content-form' }
245     * @readonly
246     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
247     * @since 14
248     */
249    readonly uniformDataType: 'general.content-form';
250
251    /**
252     * Indicates the thumb data of content form.
253     *
254     * @type { Uint8Array }
255     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
256     * @since 14
257     */
258    thumbData?: Uint8Array;
259
260    /**
261     * Indicates the description of content form.
262     *
263     * @type { string }
264     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
265     * @since 14
266     */
267    description?: string;
268
269    /**
270     * Indicates the title of content form.
271     *
272     * @type { string }
273     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
274     * @since 14
275     */
276    title: string;
277
278    /**
279     * Indicates the app icon of content form.
280     *
281     * @type { Uint8Array }
282     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
283     * @since 14
284     */
285    appIcon?: Uint8Array;
286
287    /**
288     * Indicates the app name of content form.
289     *
290     * @type { appName }
291     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
292     * @since 14
293     */
294    appName?: string;
295
296    /**
297     * Indicates the link url of content form.
298     *
299     * @type { linkUri }
300     * @syscap SystemCapability.DistributedDataManager.UDMF.Core
301     * @since 14
302     */
303    linkUri?: string;
304  }
305}
306
307export default uniformDataStruct;