• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-2025 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 * @file
17 * @kit ArkUI
18 * @arkts 1.2
19 */
20
21
22// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION!
23
24import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime'
25import { 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'
26import { 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'
27import { TextOverflow, TextHeightAdaptivePolicy, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, FontWeight, FontStyle } from './enums'
28import { Resource } from './../../../api/global/resource'
29
30export enum ButtonType {
31    CAPSULE = 0,
32    Capsule = 0,
33    CIRCLE = 1,
34    Circle = 1,
35    NORMAL = 2,
36    Normal = 2,
37    ROUNDED_RECTANGLE = 3
38}
39export enum ButtonStyleMode {
40    NORMAL = 0,
41    EMPHASIZED = 1,
42    TEXTUAL = 2
43}
44export enum ButtonRole {
45    NORMAL = 0,
46    ERROR = 1
47}
48export type ButtonTriggerClickCallback = (xPos: number, yPos: number) => void;
49export interface ButtonConfiguration extends CommonConfiguration<ButtonConfiguration> {
50    label: string;
51    pressed: boolean;
52    triggerClick: ButtonTriggerClickCallback;
53}
54export enum ControlSize {
55    SMALL = 'small',
56    NORMAL = 'normal'
57}
58export interface ButtonOptions {
59    type?: ButtonType;
60    stateEffect?: boolean;
61    buttonStyle?: ButtonStyleMode;
62    controlSize?: ControlSize;
63    role?: ButtonRole;
64}
65export interface ButtonInterface {
66    invoke(): ButtonAttribute;
67
68
69}
70export interface LabelStyle {
71    overflow?: TextOverflow;
72    maxLines?: number;
73    minFontSize?: number | ResourceStr;
74    maxFontSize?: number | ResourceStr;
75    heightAdaptivePolicy?: TextHeightAdaptivePolicy;
76    font?: Font;
77}
78export interface ButtonAttribute extends CommonMethod {
79    @memo
80    type(value: ButtonType): this;
81    @memo
82    stateEffect(value: boolean): this;
83    @memo
84    buttonStyle(value: ButtonStyleMode): this;
85    @memo
86    controlSize(value: ControlSize): this;
87    @memo
88    role(value: ButtonRole): this;
89    @memo
90    fontColor(value: ResourceColor): this;
91    @memo
92    fontSize(value: Length): this;
93    @memo
94    fontWeight(value: number | FontWeight | string): this;
95    @memo
96    fontStyle(value: FontStyle): this;
97    @memo
98    fontFamily(value: string | Resource): this;
99    @memo
100    contentModifier(value: ContentModifier<ButtonConfiguration>): this;
101    @memo
102    labelStyle(value: LabelStyle): this;
103}
104@memo
105@ComponentBuilder
106export declare function Button(
107    label?: ButtonOptions | ResourceStr | undefined, options?: ButtonOptions | undefined,
108    @memo
109    content_?: () => void,
110): ButtonAttribute
111