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 CommonEventSubscribeInfo module provides APIs for providing subscriber information. 18 * @kit BasicServicesKit 19 */ 20 21/** 22 * The CommonEventSubscribeInfo module provides APIs for providing subscriber information. 23 * 24 * @typedef CommonEventSubscribeInfo 25 * @syscap SystemCapability.Notification.CommonEvent 26 * @since 7 27 */ 28/** 29 * The CommonEventSubscribeInfo module provides APIs for providing subscriber information. 30 * 31 * @typedef CommonEventSubscribeInfo 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 CommonEventSubscribeInfo { 39 /** 40 * Common events to subscribe to. 41 * 42 * @type { Array<string> } 43 * @syscap SystemCapability.Notification.CommonEvent 44 * @since 7 45 */ 46 /** 47 * Common events to subscribe to. 48 * 49 * @type { Array<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 events: Array<string>; 57 58 /** 59 * Permission of the publisher. The subscriber can receive only the events from the publisher with this permission. 60 * 61 * @type { ?string } 62 * @syscap SystemCapability.Notification.CommonEvent 63 * @since 7 64 */ 65 /** 66 * Permission of the publisher. The subscriber can receive only the events from the publisher with this permission. 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 publisherPermission?: string; 75 76 /** 77 * Device ID. Use @ohos.deviceInfo to obtain the UDID as the device ID of the subscriber. Not supported currently. 78 * 79 * @type { ?string } 80 * @syscap SystemCapability.Notification.CommonEvent 81 * @since 7 82 */ 83 /** 84 * Device ID. Use @ohos.deviceInfo to obtain the UDID as the device ID of the subscriber. Not supported currently. 85 * 86 * @type { ?string } 87 * @syscap SystemCapability.Notification.CommonEvent 88 * @atomicservice 89 * @since arkts {'1.1':'11', '1.2':'20'} 90 * @arkts 1.1&1.2 91 */ 92 publisherDeviceId?: string; 93 94 /** 95 * User ID. If this parameter is not specified, the default value, which is the ID of the current user, will be used. 96 * The value must be an existing user ID in the system. Use getOsAccountLocalId to obtain the system account ID and use it as the user ID of the subscriber. 97 * 98 * @type { ?number } 99 * @syscap SystemCapability.Notification.CommonEvent 100 * @since 7 101 */ 102 /** 103 * User ID. If this parameter is not specified, the default value, which is the ID of the current user, will be used. 104 * The value must be an existing user ID in the system. Use getOsAccountLocalId to obtain the system account ID and use it as the user ID of the subscriber. 105 * 106 * @type { ?number } 107 * @syscap SystemCapability.Notification.CommonEvent 108 * @atomicservice 109 * @since arkts {'1.1':'11', '1.2':'20'} 110 * @arkts 1.1&1.2 111 */ 112 userId?: number; 113 114 /** 115 * Subscriber priority. The value ranges from –100 to +1000. If the value exceeds the upper or lower limit, the upper or lower limit is used. 116 * 117 * @type { ?number } 118 * @syscap SystemCapability.Notification.CommonEvent 119 * @since 7 120 */ 121 /** 122 * Subscriber priority. The value ranges from –100 to +1000. If the value exceeds the upper or lower limit, the upper or lower limit is used. 123 * 124 * @type { ?number } 125 * @syscap SystemCapability.Notification.CommonEvent 126 * @atomicservice 127 * @since arkts {'1.1':'11', '1.2':'20'} 128 * @arkts 1.1&1.2 129 */ 130 priority?: number; 131 132 /** 133 * Bundle name of the publisher to subscribe to. 134 * 135 * @type { ?string } 136 * @syscap SystemCapability.Notification.CommonEvent 137 * @atomicservice 138 * @since arkts {'1.1':'11', '1.2':'20'} 139 * @arkts 1.1&1.2 140 */ 141 publisherBundleName?: string; 142} 143