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 * @since 9 19 * @systemapi 20 */ 21interface PluginComponentTemplate { 22 /** 23 * Defines the plugin source name. 24 * @since 9 25 * @systemapi 26 */ 27 source: string; 28 /** 29 * Defines the bundle name of the Template. 30 * @since 9 31 * @systemapi 32 */ 33 bundleName: string; 34} 35 36/** 37 * Provides plugin component. 38 * @since 9 39 * @systemapi 40 */ 41interface PluginComponentInterface { 42 /** 43 * Called when setting the plugin. 44 * @since 9 45 * @systemapi 46 */ 47 (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; 48} 49 50/** 51 * Defines the plugin component attribute functions. 52 * @since 9 53 * @systemapi 54 */ 55declare class PluginComponentAttribute extends CommonMethod<PluginComponentAttribute> { 56 /** 57 * pluginComponent onComplete callback, 58 * @since 9 59 * @systemapi 60 */ 61 onComplete(callback: () => void): PluginComponentAttribute; 62 63 /** 64 * pluginComponent onError callback, 65 * @since 9 66 * @systemapi 67 */ 68 onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute; 69} 70 71/** 72 * Defines PluginComponent Component. 73 * @since 9 74 * @systemapi 75 */ 76declare const PluginComponent: PluginComponentInterface; 77 78/** 79 * Defines PluginComponent Component instance. 80 * @since 9 81 * @systemapi 82 */ 83declare const PluginComponentInstance: PluginComponentAttribute; 84