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