• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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/*** if arkts 1.2 */
21import { CommonMethod} from './common';
22
23/*** endif */
24/**
25 * Provides an Effect Component, which is invisible, but setting properties on this component defines an effect template
26 * that child components can apply by setting useEffect(true).
27 *
28 * @interface EffectComponentInterface
29 * @syscap SystemCapability.ArkUI.ArkUI.Full
30 * @systemapi
31 * @since arkts {'1.1':'10','1.2':'20'}
32 * @arkts 1.1&1.2
33 */
34interface EffectComponentInterface {
35  /**
36   * Return effectComponent.
37   *
38   * @returns { EffectComponentAttribute }
39   * @syscap SystemCapability.ArkUI.ArkUI.Full
40   * @systemapi
41   * @since arkts {'1.1':'10','1.2':'20'}
42   * @arkts 1.1&1.2
43   */
44  (): EffectComponentAttribute;
45
46  /**
47   * Return effectComponent.
48   *
49   * @param { EffectComponentOptions } [options] - EffectComponent constructor options.
50   * @returns { EffectComponentAttribute }
51   * @syscap SystemCapability.ArkUI.ArkUI.Full
52   * @systemapi
53   * @since 20
54   */
55  (options?: EffectComponentOptions): EffectComponentAttribute;
56}
57
58/**
59 * Effect layer enum.
60 *
61 * @enum { number }
62 * @syscap SystemCapability.ArkUI.ArkUI.Full
63 * @systemapi
64 * @since 20
65 */
66declare enum EffectLayer {
67  /**
68   * No layer.
69   *
70   * @syscap SystemCapability.ArkUI.ArkUI.Full
71   * @systemapi
72   * @since 20
73   */
74  NONE = 0,
75
76  /**
77   * Charge motion layer.
78   *
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @systemapi
81   * @since 20
82   */
83  CHARGE_MOTION = 1,
84
85  /**
86   * Charge text layer.
87   *
88   * @syscap SystemCapability.ArkUI.ArkUI.Full
89   * @systemapi
90   * @since 20
91   */
92  CHARGE_TEXT = 2
93}
94
95/**
96 * Defines the Effect Component constructor options.
97 *
98 * @interface EffectComponentOptions
99 * @syscap SystemCapability.ArkUI.ArkUI.Full
100 * @systemapi
101 * @since 20
102 */
103declare interface EffectComponentOptions {
104
105  /** Use this to determine the component layer 1evel. Default value is none.
106   *
107   * @type { ?EffectLayer }
108   * @syscap SystemCapability.ArkUI.ArkUI.Full
109   * @systemapi
110   * @since 20
111   */
112  effectLayer?: EffectLayer;
113}
114
115/**
116 * Defines the Effect Component attribute functions.
117 *
118 * @extends CommonMethod<EffectComponentAttribute>
119 * @syscap SystemCapability.ArkUI.ArkUI.Full
120 * @systemapi
121 * @since arkts {'1.1':'10','1.2':'20'}
122 * @arkts 1.1&1.2
123 */
124declare class EffectComponentAttribute extends CommonMethod<EffectComponentAttribute> {
125  /**
126   * Use snapshot when Effect Component have no visual effect.
127   *
128   * @param { boolean } enable
129   * @returns { EffectComponentAttribute }
130   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
131   * @syscap SystemCapability.ArkUI.ArkUI.Full
132   * @systemapi
133   * @since 19
134   */
135  alwaysSnapshot(enable: boolean): EffectComponentAttribute;
136}
137
138/**
139 * Defines Effect Component.
140 *
141 * @syscap SystemCapability.ArkUI.ArkUI.Full
142 * @systemapi
143 * @since 10
144 */
145declare const EffectComponent: EffectComponentInterface;
146
147/**
148 * Defines Effect Component instance.
149 *
150 * @syscap SystemCapability.ArkUI.ArkUI.Full
151 * @systemapi
152 * @since 10
153 */
154declare const EffectComponentInstance: EffectComponentAttribute;
155