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