• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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 8
19 */
20interface PluginComponentTemplate {
21  /**
22   * Defines the plugin source name.
23   * @since 8
24   */
25  source: string;
26  /**
27   * Defines the ability name.
28   * @since 8
29   */
30  ability: string;
31}
32
33/**
34 * Provides plugin component.
35 * @since 8
36 */
37interface PluginComponentInterface {
38  /**
39   * Called when setting the plugin.
40   * @since 8
41   */
42  (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
43}
44
45/**
46 * Defines the plugin component attibute functions.
47 * @since 8
48 */
49declare class PluginComponentAttribute extends CommonMethod<PluginComponentAttribute> {
50  /**
51   * Set pluginComponent size,
52   * @since 8
53   */
54  size(value: { width: number; height: number }): PluginComponentAttribute;
55
56  /**
57   * pluginComponent onComplete callback,
58   * @since 8
59   */
60  onComplete(callback: () => void): PluginComponentAttribute;
61
62  /**
63   * pluginComponent onError callback,
64   * @since 8
65   */
66  onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute;
67}
68
69declare const PluginComponent: PluginComponentInterface;
70declare const PluginComponentInstance: PluginComponentAttribute;
71