• 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
16/**
17 * PluginComponentTemplate
18 *
19 * @interface PluginComponentTemplate
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @systemapi
22 * @since 9
23 */
24interface PluginComponentTemplate {
25  /**
26   * Defines the plugin source name.
27   *
28   * @type { string }
29   * @syscap SystemCapability.ArkUI.ArkUI.Full
30   * @systemapi
31   * @since 9
32   */
33  source: string;
34  /**
35   * Defines the bundle name of the Template.
36   *
37   * @type { string }
38   * @syscap SystemCapability.ArkUI.ArkUI.Full
39   * @systemapi
40   * @since 9
41   */
42  bundleName: string;
43}
44
45/**
46 * Provides plugin component.
47 *
48 * @interface PluginComponentInterface
49 * @syscap SystemCapability.ArkUI.ArkUI.Full
50 * @systemapi
51 * @since 9
52 */
53interface PluginComponentInterface {
54  /**
55   * Called when setting the plugin.
56   *
57   * @param { object } value
58   * @returns { PluginComponentAttribute }
59   * @syscap SystemCapability.ArkUI.ArkUI.Full
60   * @systemapi
61   * @since 9
62   */
63  (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
64}
65
66/**
67 * Defines the plugin component attribute functions.
68 *
69 * @extends CommonMethod
70 * @syscap SystemCapability.ArkUI.ArkUI.Full
71 * @systemapi
72 * @since 9
73 */
74declare class PluginComponentAttribute extends CommonMethod<PluginComponentAttribute> {
75  /**
76   * pluginComponent onComplete callback,
77   *
78   * @param { function } callback
79   * @returns { PluginComponentAttribute }
80   * @syscap SystemCapability.ArkUI.ArkUI.Full
81   * @systemapi
82   * @since 9
83   */
84  onComplete(callback: () => void): PluginComponentAttribute;
85
86  /**
87   * pluginComponent onError callback,
88   *
89   * @param { function } callback
90   * @returns { PluginComponentAttribute }
91   * @syscap SystemCapability.ArkUI.ArkUI.Full
92   * @systemapi
93   * @since 9
94   */
95  onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute;
96}
97
98/**
99 * Defines PluginComponent Component.
100 *
101 * @syscap SystemCapability.ArkUI.ArkUI.Full
102 * @systemapi
103 * @since 9
104 */
105declare const PluginComponent: PluginComponentInterface;
106
107/**
108 * Defines PluginComponent Component instance.
109 *
110 * @syscap SystemCapability.ArkUI.ArkUI.Full
111 * @systemapi
112 * @since 9
113 */
114declare const PluginComponentInstance: PluginComponentAttribute;
115