• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2024 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 Sets filter criteria of publishers for subscribing to desired notifications
18 * @kit NotificationKit
19 */
20
21import type notificationManager from '../@ohos.notificationManager';
22
23/**
24 * Sets filter criteria of publishers for subscribing to desired notifications.
25 *
26 * @typedef NotificationSubscribeInfo
27 * @syscap SystemCapability.Notification.Notification
28 * @systemapi
29 * @since 7
30 */
31export interface NotificationSubscribeInfo {
32  /**
33   * Notifications from APP that specify which package names to subscribe to.
34   *
35   * @type { ?Array<string> }
36   * @syscap SystemCapability.Notification.Notification
37   * @systemapi
38   * @since 7
39   */
40  bundleNames?: Array<string>;
41
42  /**
43   * Specify which user to subscribe to the notification from.
44   *
45   * @type { ?number }
46   * @syscap SystemCapability.Notification.Notification
47   * @systemapi
48   * @since 7
49   */
50  userId?: number;
51
52  /**
53   * Subscribing to Notifications Synchronized to Devices of a Specified Type.
54   *
55   * @type { ?string }
56   * @syscap SystemCapability.Notification.Notification
57   * @systemapi
58   * @since 12
59   */
60  deviceType?: string;
61
62  /**
63   * Specifies the scope of notification slots for subscription.
64   *
65   * @type { ?Array<notificationManager.SlotType> }
66   * @syscap SystemCapability.Notification.Notification
67   * @systemapi
68   * @since 18
69   */
70  slotTypes?: Array<notificationManager.SlotType>;
71
72  /**
73   * Filtered notification type range.
74   *
75   * @type { ?number }
76   * @syscap SystemCapability.Notification.Notification
77   * @systemapi
78   * @since 18
79   */
80  filterLimit?: number;
81}
82