!14406 useEffect 接口变更

Merge pull request !14406 from happy/wxl_useEffect
This commit is contained in:
openharmony_ci 2024-11-01 12:51:26 +00:00 committed by Gitee
commit bacb548238
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -4771,6 +4771,33 @@ declare interface ItemDragInfo {
y: number;
}
/**
* Enum of using the effects template mode.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 14
*/
declare enum EffectType {
/**
* Define use the effects template defined by the parent effectComponent.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 14
*/
DEFAULT = 0,
/**
* Define use the effects template defined by the window.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 14
*/
WINDOW_EFFECT = 1,
}
/**
* Defines the drag status before drag action.
*
@ -17647,6 +17674,20 @@ declare class CommonMethod<T> {
*/
useShadowBatching(value: boolean): T;
/**
* Sets whether the component should apply the effects template defined by the parent effectComponent or window.
* If multiple parent effectComponents are found, the nearest one will be used.
* If no parent effectComponent is found, this method has no effect.
*
* @param { boolean } useEffect - true means the component should apply the effects template defined by the parent effectComponent or window.
* @param { EffectType } effectType - the effect type of the effects template, defined by the parent effectComponent or window.
* @returns { T } return the component attribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 14
*/
useEffect(useEffect: boolean, effectType: EffectType): T;
/**
* Sets whether the component should apply the effects template defined by the parent effectComponent.
* If multiple parent effectComponents are found, the nearest one will be used.