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 information of the subscriber
18 * @kit BasicServicesKit
19 */
20
21/**
22 * the information of the subscriber
23 *
24 * @typedef CommonEventSubscribeInfo
25 * @syscap SystemCapability.Notification.CommonEvent
26 * @since 7
27 */
28/**
29 * the information of the subscriber
30 *
31 * @typedef CommonEventSubscribeInfo
32 * @syscap SystemCapability.Notification.CommonEvent
33 * @crossplatform
34 * @atomicservice
35 * @since 11
36 */
37export interface CommonEventSubscribeInfo {
38  /**
39   * Indicates the subscribed events.
40   *
41   * @type { Array<string> }
42   * @syscap SystemCapability.Notification.CommonEvent
43   * @since 7
44   */
45  /**
46   * Indicates the subscribed events.
47   *
48   * @type { Array<string> }
49   * @syscap SystemCapability.Notification.CommonEvent
50   * @crossplatform
51   * @atomicservice
52   * @since 11
53   */
54  events: Array<string>;
55
56  /**
57   * The permission that the publisher must have in order to send a common event to this subscriber.
58   * This subscriber receives only common events sent by publishers granted with this permission.
59   *
60   * @type { ?string }
61   * @syscap SystemCapability.Notification.CommonEvent
62   * @since 7
63   */
64  /**
65   * The permission that the publisher must have in order to send a common event to this subscriber.
66   * This subscriber receives only common events sent by publishers granted with this permission.
67   *
68   * @type { ?string }
69   * @syscap SystemCapability.Notification.CommonEvent
70   * @atomicservice
71   * @since 11
72   */
73  publisherPermission?: string;
74
75  /**
76   * deviceId Indicates the device ID. The value must be an existing device ID on the same ohos network.
77   *
78   * @type { ?string }
79   * @syscap SystemCapability.Notification.CommonEvent
80   * @since 7
81   */
82  /**
83   * deviceId Indicates the device ID. The value must be an existing device ID on the same ohos network.
84   *
85   * @type { ?string }
86   * @syscap SystemCapability.Notification.CommonEvent
87   * @atomicservice
88   * @since 11
89   */
90  publisherDeviceId?: string;
91
92  /**
93   * Indicates the user ID. This parameter is optional, and the default value is the ID of the
94   * current user. If this parameter is specified, the value must be an existing user ID in the system.
95   *
96   * @type { ?number }
97   * @syscap SystemCapability.Notification.CommonEvent
98   * @since 7
99   */
100  /**
101   * Indicates the user ID. This parameter is optional, and the default value is the ID of the
102   * current user. If this parameter is specified, the value must be an existing user ID in the system.
103   *
104   * @type { ?number }
105   * @syscap SystemCapability.Notification.CommonEvent
106   * @atomicservice
107   * @since 11
108   */
109  userId?: number;
110
111  /**
112   * Indicates the subscriber priority. The value ranges from -100 to 1000.
113   *
114   * @type { ?number }
115   * @syscap SystemCapability.Notification.CommonEvent
116   * @since 7
117   */
118  /**
119   * Indicates the subscriber priority. The value ranges from -100 to 1000.
120   *
121   * @type { ?number }
122   * @syscap SystemCapability.Notification.CommonEvent
123   * @atomicservice
124   * @since 11
125   */
126  priority?: number;
127
128  /**
129   * Specify the publisher's bundleName to subscribe.
130   *
131   * @type { ?string }
132   * @syscap SystemCapability.Notification.CommonEvent
133   * @atomicservice
134   * @since 11
135   */
136  publisherBundleName?: string;
137}
138