1/*
2 * Copyright (c) 2021-2023 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 Containing the common event content and attributes
18 * @kit BasicServicesKit
19 */
20
21/**
22 * containing the common event content and attributes
23 *
24 * @typedef CommonEventPublishData
25 * @syscap SystemCapability.Notification.CommonEvent
26 * @since 7
27 */
28/**
29 * containing the common event content and attributes
30 *
31 * @typedef CommonEventPublishData
32 * @syscap SystemCapability.Notification.CommonEvent
33 * @atomicservice
34 * @since 11
35 */
36/**
37 * containing the common event content and attributes
38 *
39 * @typedef CommonEventPublishData
40 * @syscap SystemCapability.Notification.CommonEvent
41 * @crossplatform
42 * @atomicservice
43 * @since 12
44 */
45export interface CommonEventPublishData {
46  /**
47   * bundle name
48   *
49   * @type { ?string }
50   * @syscap SystemCapability.Notification.CommonEvent
51   * @since 7
52   */
53  /**
54   * bundle name
55   *
56   * @type { ?string }
57   * @syscap SystemCapability.Notification.CommonEvent
58   * @atomicservice
59   * @since 11
60   */
61  bundleName?: string;
62
63  /**
64   * The custom result code of the common event.
65   *
66   * @type { ?number }
67   * @default 0
68   * @syscap SystemCapability.Notification.CommonEvent
69   * @since 7
70   */
71  /**
72   * The custom result code of the common event.
73   *
74   * @type { ?number }
75   * @default 0
76   * @syscap SystemCapability.Notification.CommonEvent
77   * @atomicservice
78   * @since 11
79   */
80  code?: number;
81
82  /**
83   * The custom result data of the common event.
84   *
85   * @type { ?string }
86   * @syscap SystemCapability.Notification.CommonEvent
87   * @since 7
88   */
89  /**
90   * The custom result data of the common event.
91   *
92   * @type { ?string }
93   * @syscap SystemCapability.Notification.CommonEvent
94   * @atomicservice
95   * @since 11
96   */
97  /**
98   * The custom result data of the common event.
99   *
100   * @type { ?string }
101   * @syscap SystemCapability.Notification.CommonEvent
102   * @crossplatform
103   * @atomicservice
104   * @since 12
105   */
106  data?: string;
107
108  /**
109   * The permissions for subscribers. Only subscribers with required permissions can receive published common events.
110   *
111   * @type { ?Array<string> }
112   * @syscap SystemCapability.Notification.CommonEvent
113   * @since 7
114   */
115  /**
116   * The permissions for subscribers. Only subscribers with required permissions can receive published common events.
117   *
118   * @type { ?Array<string> }
119   * @syscap SystemCapability.Notification.CommonEvent
120   * @atomicservice
121   * @since 11
122   */
123  subscriberPermissions?: Array<string>;
124
125  /**
126   * Whether the type of a common event is ordered or not.
127   *
128   * @type { ?boolean }
129   * @default false
130   * @syscap SystemCapability.Notification.CommonEvent
131   * @since 7
132   */
133  isOrdered?: boolean;
134
135  /**
136   * Whether the type of a common event is sticky or not.
137   *
138   * @type { ?boolean }
139   * @default false
140   * @syscap SystemCapability.Notification.CommonEvent
141   * @since 7
142   */
143  isSticky?: boolean;
144
145  /**
146   * The description of the parameters in a common event.
147   *
148   * @type { ?object }
149   * @syscap SystemCapability.Notification.CommonEvent
150   * @since 7
151   */
152  /**
153   * The description of the parameters in a common event.
154   *
155   * @type { ?object }
156   * @syscap SystemCapability.Notification.CommonEvent
157   * @atomicservice
158   * @since 11
159   */
160  parameters?: { [key: string]: any };
161}
162