• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 The CommonEventPublishData module provides APIs for defining common event content and attributes.
18 * @kit BasicServicesKit
19 */
20
21/**
22 * The CommonEventPublishData module provides APIs for defining common event content and attributes.
23 *
24 * @typedef CommonEventPublishData
25 * @syscap SystemCapability.Notification.CommonEvent
26 * @since 7
27 */
28/**
29 * The CommonEventPublishData module provides APIs for defining common event content and attributes.
30 *
31 * @typedef CommonEventPublishData
32 * @syscap SystemCapability.Notification.CommonEvent
33 * @atomicservice
34 * @since 11
35 */
36/**
37 * The CommonEventPublishData module provides APIs for defining common event content and attributes.
38 *
39 * @typedef CommonEventPublishData
40 * @syscap SystemCapability.Notification.CommonEvent
41 * @crossplatform
42 * @atomicservice
43 * @since arkts {'1.1':'12', '1.2':'20'}
44 * @arkts 1.1&1.2
45 */
46export interface CommonEventPublishData {
47  /**
48   * Bundle name of the subscriber that can receive the common event.
49   *
50   * @type { ?string }
51   * @syscap SystemCapability.Notification.CommonEvent
52   * @since 7
53   */
54  /**
55   * Bundle name of the subscriber that can receive the common event.
56   *
57   * @type { ?string }
58   * @syscap SystemCapability.Notification.CommonEvent
59   * @atomicservice
60   * @since arkts {'1.1':'11', '1.2':'20'}
61   * @arkts 1.1&1.2
62   */
63  bundleName?: string;
64
65  /**
66   * Common event data transferred by the publisher. The default value is 0.
67   *
68   * @type { ?number }
69   * @default 0
70   * @syscap SystemCapability.Notification.CommonEvent
71   * @since 7
72   */
73  /**
74   * Common event data transferred by the publisher. The default value is 0.
75   *
76   * @type { ?number }
77   * @default 0
78   * @syscap SystemCapability.Notification.CommonEvent
79   * @atomicservice
80   * @since arkts {'1.1':'11', '1.2':'20'}
81   * @arkts 1.1&1.2
82   */
83  code?: number;
84
85  /**
86   * Common event data transferred by the publisher. The data size cannot exceed 64 KB.
87   *
88   * @type { ?string }
89   * @syscap SystemCapability.Notification.CommonEvent
90   * @since 7
91   */
92  /**
93   * Common event data transferred by the publisher. The data size cannot exceed 64 KB.
94   *
95   * @type { ?string }
96   * @syscap SystemCapability.Notification.CommonEvent
97   * @atomicservice
98   * @since 11
99   */
100  /**
101   * Common event data transferred by the publisher. The data size cannot exceed 64 KB.
102   *
103   * @type { ?string }
104   * @syscap SystemCapability.Notification.CommonEvent
105   * @crossplatform
106   * @atomicservice
107   * @since arkts {'1.1':'12', '1.2':'20'}
108   * @arkts 1.1&1.2
109   */
110  data?: string;
111
112  /**
113   * Permissions required for subscribers to receive the common event.
114   *
115   * @type { ?Array<string> }
116   * @syscap SystemCapability.Notification.CommonEvent
117   * @since 7
118   */
119  /**
120   * Permissions required for subscribers to receive the common event.
121   *
122   * @type { ?Array<string> }
123   * @syscap SystemCapability.Notification.CommonEvent
124   * @atomicservice
125   * @since arkts {'1.1':'11', '1.2':'20'}
126   * @arkts 1.1&1.2
127   */
128  subscriberPermissions?: Array<string>;
129
130  /**
131   * Whether the common event is an ordered one.
132   *
133   * @type { ?boolean }
134   * @default false
135   * @syscap SystemCapability.Notification.CommonEvent
136   * @since arkts {'1.1':'7', '1.2':'20'}
137   * @arkts 1.1&1.2
138   */
139  isOrdered?: boolean;
140
141  /**
142   * Whether the common event is a sticky one. Only system applications and system services are allowed to send sticky events.
143   *
144   * @permission ohos.permission.COMMONEVENT_STICKY
145   * @type { ?boolean }
146   * @default false
147   * @syscap SystemCapability.Notification.CommonEvent
148   * @since arkts {'1.1':'7', '1.2':'20'}
149   * @arkts 1.1&1.2
150   */
151  isSticky?: boolean;
152
153  /**
154   * Additional information about the common event transferred by the publisher.
155   *
156   * @type { ?object }
157   * @syscap SystemCapability.Notification.CommonEvent
158   * @since 7
159   */
160  /**
161   * Additional information about the common event transferred by the publisher.
162   *
163   * @type { ?object }
164   * @syscap SystemCapability.Notification.CommonEvent
165   * @atomicservice
166   * @since 11
167   */
168  parameters?: { [key: string]: any };
169
170  /**
171   * The description of the parameters in a common event.
172   *
173   * @type { ?Record<string, Object> }
174   * @syscap SystemCapability.Notification.CommonEvent
175   * @since 20
176   * @arkts 1.2
177   */
178  parameters?: Record<string, Object>;
179}
180