• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 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 * containing the common event content and attributes
18 * @name CommonEventPublishData
19 * @since 7
20 * @syscap SystemCapability.Notification.CommonEvent
21 * @permission N/A
22 */
23export interface CommonEventPublishData {
24  /**
25   * bundle name
26   * @default -
27   * @since 7
28   */
29  bundleName?: string;
30
31  /**
32   * The custom result code of the common event.
33   *
34   * @default 0
35   * @since 7
36   */
37  code?: number;
38
39  /**
40   * The custom result data of the common event.
41   *
42   * @default ""
43   * @since 7
44   */
45  data?: string;
46
47  /**
48   * The permissions for subscribers. Only subscribers with required permissions can receive published common events.
49   *
50   * @default -
51   * @since 7
52   */
53  subscriberPermissions?: Array<string>;
54
55  /**
56   * Whether the type of a common event is ordered or not.
57   *
58   * @default false
59   * @since 7
60   */
61  isOrdered?: boolean;
62
63  /**
64   * Whether the type of a common event is sticky or not.
65   *
66   * @default false
67   * @since 7
68   */
69  isSticky?: boolean;
70
71  /**
72   * The description of the parameters in a common event.
73   *
74   * @default -
75   * @since 7
76   */
77  parameters?: {[key: string]: any};
78}
79