• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2020 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
16export interface ActionResult {
17  /**
18   * Bundle name of the application to be redirected to after the notification is clicked.
19   * @since 3
20   */
21  bundleName: string;
22
23  /**
24   * Ability name of the application to be redirected to after the notification is clicked.
25   * @since 3
26   */
27  abilityName: string;
28
29  /**
30   * URI of the page to be redirected to. The supported URI formats are as follows:
31   * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example:
32   * pages/index/index
33   * pages/detail/detail
34   * 2. Particular path. If the value is a slash (/), the home page is displayed.
35   * @since 3
36   */
37  uri: string;
38}
39
40export interface ShowNotificationOptions {
41  /**
42   * Notification title.
43   * @since 3
44   */
45  contentTitle?: string;
46
47  /**
48   * Notification content.
49   * @since 3
50   */
51  contentText?: string;
52
53  /**
54   * Action triggered after the notification is clicked.
55   * @since 3
56   */
57  clickAction?: ActionResult;
58}
59
60/**
61 * @Syscap SysCap.ACE.UIEngine
62 */
63export default class Notification {
64    /**
65     * Displays the notification.
66     * @param options
67     */
68    static show(options?: ShowNotificationOptions): void;
69}