• 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 arkts {'1.1':'7', '1.2':'20'}
30 * @arkts 1.1&1.2
31 */
32export interface NotificationSubscribeInfo {
33  /**
34   * Notifications from APP that specify which package names to subscribe to.
35   *
36   * @type { ?Array<string> }
37   * @syscap SystemCapability.Notification.Notification
38   * @systemapi
39   * @since arkts {'1.1':'7', '1.2':'20'}
40   * @arkts 1.1&1.2
41   */
42  bundleNames?: Array<string>;
43
44  /**
45   * Specify which user to subscribe to the notification from.
46   *
47   * @type { ?number }
48   * @syscap SystemCapability.Notification.Notification
49   * @systemapi
50   * @since arkts {'1.1':'7', '1.2':'20'}
51   * @arkts 1.1&1.2
52   */
53  userId?: number;
54
55  /**
56   * Subscribing to Notifications Synchronized to Devices of a Specified Type.
57   *
58   * @type { ?string }
59   * @syscap SystemCapability.Notification.Notification
60   * @systemapi
61   * @since arkts {'1.1':'12', '1.2':'20'}
62   * @arkts 1.1&1.2
63   */
64  deviceType?: string;
65
66  /**
67   * Specifies the scope of notification slots for subscription.
68   *
69   * @type { ?Array<notificationManager.SlotType> }
70   * @syscap SystemCapability.Notification.Notification
71   * @systemapi
72   * @since 18
73   */
74  slotTypes?: Array<notificationManager.SlotType>;
75
76  /**
77   * Filtered notification type range.
78   *
79   * @type { ?number }
80   * @syscap SystemCapability.Notification.Notification
81   * @systemapi
82   * @since arkts {'1.1':'18', '1.2':'20'}
83   * @arkts 1.1&1.2
84   */
85  filterLimit?: number;
86}
87