• 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
16import notification from '../@ohos.notification';
17
18/**
19 * Describes a NotificationSlot instance.
20 *
21 * @typedef NotificationSlot
22 * @syscap SystemCapability.Notification.Notification
23 * @since 7
24 */
25export interface NotificationSlot {
26  /**
27   * Obtains the type of a notification slot.
28   *
29   * @type { notification.SlotType }
30   * @syscap SystemCapability.Notification.Notification
31   * @since 7
32   */
33  type: notification.SlotType;
34
35  /**
36   * Obtains the level of a notification slot
37   *
38   * @type { ?notification.SlotLevel }
39   * @syscap SystemCapability.Notification.Notification
40   * @since 7
41   */
42  level?: notification.SlotLevel;
43
44  /**
45   * Obtains the description of a notification slot.
46   *
47   * @type { ?string }
48   * @syscap SystemCapability.Notification.Notification
49   * @since 7
50   */
51  desc?: string;
52
53  /**
54   * Obtains the application icon badge status of a notification slot.
55   *
56   * @type { ?boolean }
57   * @syscap SystemCapability.Notification.Notification
58   * @since 7
59   */
60  badgeFlag?: boolean;
61
62  /**
63   * Obtains whether DND mode is bypassed for a notification slot.
64   *
65   * @type { ?boolean }
66   * @syscap SystemCapability.Notification.Notification
67   * @since 7
68   */
69  bypassDnd?: boolean;
70
71  /**
72   * Whether and how to display notifications on the lock screen.
73   *
74   * @type { ?number }
75   * @syscap SystemCapability.Notification.Notification
76   * @since 7
77   */
78  lockscreenVisibility?: number;
79
80  /**
81   * Obtains the vibration status of the notification slot.
82   *
83   * @type { ?boolean }
84   * @syscap SystemCapability.Notification.Notification
85   * @since 7
86   */
87  vibrationEnabled?: boolean;
88
89  /**
90   * Obtains the prompt tone of the notification slot.
91   *
92   * @type { ?string }
93   * @syscap SystemCapability.Notification.Notification
94   * @since 7
95   */
96  sound?: string;
97
98  /**
99   * Obtains whether the notification light is enabled in a notification slot.
100   *
101   * @type { ?boolean }
102   * @syscap SystemCapability.Notification.Notification
103   * @since 7
104   */
105  lightEnabled?: boolean;
106
107  /**
108   * Obtains the color of the notification light in a notification slot.
109   *
110   * @type { ?number }
111   * @syscap SystemCapability.Notification.Notification
112   * @since 7
113   */
114  lightColor?: number;
115
116  /**
117   * Obtains the vibration style of notifications in this notification slot.
118   *
119   * @type { ?Array<number> }
120   * @syscap SystemCapability.Notification.Notification
121   * @since 7
122   */
123  vibrationValues?: Array<number>;
124
125  /**
126   * Read-only enabled status in this notification slot.
127   *
128   * @type { ?boolean }
129   * @syscap SystemCapability.Notification.Notification
130   * @since 9
131   */
132  readonly enabled?: boolean;
133}
134