• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 * Provide an interface for the ability component.
18 *
19 * @interface AbilityComponentInterface
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @systemapi
22 * @since 9
23 * @deprecated since 10
24 * @useinstead UIExtensionComponentInterface
25 */
26interface AbilityComponentInterface {
27  /**
28   * Construct the ability component.
29   * Called when the ability component is used.
30   *
31   * @param { object } value
32   * @returns { AbilityComponentAttribute }
33   * @syscap SystemCapability.ArkUI.ArkUI.Full
34   * @systemapi
35   * @since 9
36   * @deprecated since 10
37   * @useinstead UIExtensionComponentInterface
38   */
39  (value: { want: import('../api/@ohos.app.ability.Want').default }): AbilityComponentAttribute;
40}
41
42/**
43 * Define the attribute functions of ability component.
44 *
45 * @extends CommonMethod
46 * @syscap SystemCapability.ArkUI.ArkUI.Full
47 * @systemapi
48 * @since 9
49 * @deprecated since 10
50 * @useinstead UIExtensionComponentAttribute
51 */
52declare class AbilityComponentAttribute extends CommonMethod<AbilityComponentAttribute> {
53  /**
54   * Called when the component is connected to ability.
55   *
56   * @param { function } callback - A callback instance used when connected.
57   * @returns { AbilityComponentAttribute }
58   * @syscap SystemCapability.ArkUI.ArkUI.Full
59   * @systemapi
60   * @since 9
61   * @deprecated since 10
62   * @useinstead UIExtensionComponent#onRemoteReady
63   */
64  onConnect(callback: () => void): AbilityComponentAttribute;
65  /**
66   * Called when the component is disconnected.
67   *
68   * @param { function } callback - A callback instance used when disconnected.
69   * @returns { AbilityComponentAttribute }
70   * @syscap SystemCapability.ArkUI.ArkUI.Full
71   * @systemapi
72   * @since 9
73   * @deprecated since 10
74   * @useinstead UIExtensionComponent#onRelease
75   */
76  onDisconnect(callback: () => void): AbilityComponentAttribute;
77}
78
79/**
80 * Defines AbilityComponent Component.
81 *
82 * @syscap SystemCapability.ArkUI.ArkUI.Full
83 * @since 9
84 * @deprecated since 10
85 * @useinstead UIExtensionComponent
86 */
87declare const AbilityComponent: AbilityComponentInterface;
88
89/**
90 * Defines AbilityComponent Component instance.
91 *
92 * @syscap SystemCapability.ArkUI.ArkUI.Full
93 * @since 9
94 * @deprecated since 10
95 * @useinstead UIExtensionComponentInstance
96 */
97declare const AbilityComponentInstance: AbilityComponentAttribute;
98