/* * Copyright (c) 2024-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * @kit ArkUI * @arkts 1.2 */ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' import { CommonConfiguration, ContentModifier, CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback } from './common' import { ResourceStr, Font, VisualEffect, Filter, UniformDataType, Blender, Length, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, AccessibilityOptions, PixelMap } from './units' import { TextOverflow, TextHeightAdaptivePolicy, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, FontWeight, FontStyle } from './enums' import { Resource } from './../../../api/global/resource' export enum ButtonType { CAPSULE = 0, Capsule = 0, CIRCLE = 1, Circle = 1, NORMAL = 2, Normal = 2, ROUNDED_RECTANGLE = 3 } export enum ButtonStyleMode { NORMAL = 0, EMPHASIZED = 1, TEXTUAL = 2 } export enum ButtonRole { NORMAL = 0, ERROR = 1 } export type ButtonTriggerClickCallback = (xPos: number, yPos: number) => void; export interface ButtonConfiguration extends CommonConfiguration { label: string; pressed: boolean; triggerClick: ButtonTriggerClickCallback; } export enum ControlSize { SMALL = 'small', NORMAL = 'normal' } export interface ButtonOptions { type?: ButtonType; stateEffect?: boolean; buttonStyle?: ButtonStyleMode; controlSize?: ControlSize; role?: ButtonRole; } export interface ButtonInterface { invoke(): ButtonAttribute; } export interface LabelStyle { overflow?: TextOverflow; maxLines?: number; minFontSize?: number | ResourceStr; maxFontSize?: number | ResourceStr; heightAdaptivePolicy?: TextHeightAdaptivePolicy; font?: Font; } export interface ButtonAttribute extends CommonMethod { @memo type(value: ButtonType): this; @memo stateEffect(value: boolean): this; @memo buttonStyle(value: ButtonStyleMode): this; @memo controlSize(value: ControlSize): this; @memo role(value: ButtonRole): this; @memo fontColor(value: ResourceColor): this; @memo fontSize(value: Length): this; @memo fontWeight(value: number | FontWeight | string): this; @memo fontStyle(value: FontStyle): this; @memo fontFamily(value: string | Resource): this; @memo contentModifier(value: ContentModifier): this; @memo labelStyle(value: LabelStyle): this; } @memo @ComponentBuilder export declare function Button( label?: ButtonOptions | ResourceStr | undefined, options?: ButtonOptions | undefined, @memo content_?: () => void, ): ButtonAttribute