• 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 Common event data.
18 * @kit BasicServicesKit
19 */
20
21/**
22 * Common event data.
23 *
24 * @typedef CommonEventData
25 * @syscap SystemCapability.Notification.CommonEvent
26 * @since 7
27 */
28/**
29 * Common event data.
30 *
31 * @typedef CommonEventData
32 * @syscap SystemCapability.Notification.CommonEvent
33 * @crossplatform
34 * @atomicservice
35 * @since arkts {'1.1':'11', '1.2':'20'}
36 * @arkts 1.1&1.2
37 */
38export interface CommonEventData {
39  /**
40   * Name of the common event that is being received.
41   *
42   * @type { string }
43   * @syscap SystemCapability.Notification.CommonEvent
44   * @since 7
45   */
46  /**
47   * Name of the common event that is being received.
48   *
49   * @type { string }
50   * @syscap SystemCapability.Notification.CommonEvent
51   * @crossplatform
52   * @atomicservice
53   * @since arkts {'1.1':'11', '1.2':'20'}
54   * @arkts 1.1&1.2
55   */
56  event: string;
57
58  /**
59   * Bundle name. This parameter is left empty by default.
60   *
61   * @type { ?string }
62   * @syscap SystemCapability.Notification.CommonEvent
63   * @since 7
64   */
65  /**
66   * Bundle name. This parameter is left empty by default.
67   *
68   * @type { ?string }
69   * @syscap SystemCapability.Notification.CommonEvent
70   * @atomicservice
71   * @since arkts {'1.1':'11', '1.2':'20'}
72   * @arkts 1.1&1.2
73   */
74  bundleName?: string;
75
76  /**
77   * Common event data received by the subscriber. The value of this field is the same as that of the code field in
78   * CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event. The default value is 0.
79   *
80   * @type { ?number }
81   * @default 0
82   * @syscap SystemCapability.Notification.CommonEvent
83   * @since 7
84   */
85  /**
86   * Common event data received by the subscriber. The value of this field is the same as that of the code field in
87   * CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event. The default value is 0.
88   *
89   * @type { ?number }
90   * @default 0
91   * @syscap SystemCapability.Notification.CommonEvent
92   * @atomicservice
93   * @since arkts {'1.1':'11', '1.2':'20'}
94   * @arkts 1.1&1.2
95   */
96  code?: number;
97
98  /**
99   * Common event data received by the subscriber. The value of this field is the same as that of the data field in
100   * CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event.
101   *
102   * @type { ?string }
103   * @syscap SystemCapability.Notification.CommonEvent
104   * @since 7
105   */
106  /**
107   * Common event data received by the subscriber. The value of this field is the same as that of the data field in
108   * CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event.
109   *
110   * @type { ?string }
111   * @syscap SystemCapability.Notification.CommonEvent
112   * @atomicservice
113   * @since 11
114   */
115  /**
116   * Common event data received by the subscriber. The value of this field is the same as that of the data field in
117   * CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event.
118   *
119   * @type { ?string }
120   * @syscap SystemCapability.Notification.CommonEvent
121   * @crossplatform
122   * @atomicservice
123   * @since arkts {'1.1':'12', '1.2':'20'}
124   * @arkts 1.1&1.2
125   */
126  data?: string;
127
128  /**
129   * Additional information about the common event received by the subscriber. The value of this field is the same as
130   * that of the parameters field in CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event.
131   *
132   * @type { ?object }
133   * @syscap SystemCapability.Notification.CommonEvent
134   * @since 7
135   */
136  /**
137   * Additional information about the common event received by the subscriber. The value of this field is the same as
138   * that of the parameters field in CommonEventPublishData when the publisher uses commonEventManager.publish to publish a common event.
139   *
140   * @type { ?object }
141   * @syscap SystemCapability.Notification.CommonEvent
142   * @atomicservice
143   * @since 11
144   */
145  parameters?: { [key: string]: any };
146
147  /**
148   * The description of the parameters in a common event.
149   *
150   * @type { ?Record<string, Object> }
151   * @syscap SystemCapability.Notification.CommonEvent
152   * @since 20
153   * @arkts 1.2
154   */
155  parameters?: Record<string, Object>;
156}
157