• 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 { SystemBarStyle, Length, ResourceStr, ResourceColor, Dimension, VisualEffect, Filter, UniformDataType, Blender, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, AccessibilityOptions, PixelMap } from './units'
25import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime'
26import { Resource } from './../../../api/global/resource'
27import { CustomBuilder, BlurStyle, 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, 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, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, LayoutSafeAreaType, LayoutSafeAreaEdge } from './common'
28import { TitleHeight, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey } from './enums'
29import { SymbolGlyphModifier } from './../../../api/arkui/SymbolGlyphModifier'
30
31import { LengthMetrics } from './../Graphics'
32import { TextModifier } from './../../../api/arkui/TextModifier'
33
34export interface NavigationCommonTitle {
35    main: string | Resource;
36    sub: string | Resource;
37}
38export interface NavigationCustomTitle {
39    builder: CustomBuilder;
40    height: TitleHeight | Length;
41}
42export enum NavigationMode {
43    STACK = 0,
44    Stack = 0,
45    SPLIT = 1,
46    Split = 1,
47    AUTO = 2,
48    Auto = 2
49}
50export enum NavBarPosition {
51    START = 0,
52    Start = 0,
53    END = 1,
54    End = 1
55}
56export enum NavigationTitleMode {
57    FREE = 0,
58    Free = 0,
59    FULL = 1,
60    Full = 1,
61    MINI = 2,
62    Mini = 2
63}
64export interface NavigationMenuItem {
65    value: string | Resource;
66    icon?: string | Resource;
67    symbolIcon?: SymbolGlyphModifier;
68    isEnabled?: boolean;
69    action?: (() => void);
70}
71export interface PopInfo {
72    info: NavPathInfo;
73    result: Object;
74}
75export type Callback_PopInfo_Void = (parameter: PopInfo) => void;
76export interface NavPathInfo {
77    name: string;
78    param?: object;
79    onPop?: ((parameter: PopInfo) => void);
80    isEntry?: boolean;
81}
82export enum LaunchMode {
83    STANDARD = 0,
84    MOVE_TO_TOP_SINGLETON = 1,
85    POP_TO_SINGLETON = 2,
86    NEW_INSTANCE = 3
87}
88export interface NavigationOptions {
89    launchMode?: LaunchMode;
90    animated?: boolean;
91}
92export declare class NavPathStack {
93    pushPath(info: NavPathInfo, animated?: boolean): void
94
95    pushDestination(info: NavPathInfo, animated?: boolean): Promise<void>
96
97    pushPathByName(name: string, param: object, animated?: boolean): void
98
99    pushDestinationByName(name: string, param: Object, animated?: boolean): Promise<void>
100
101    replacePath(info: NavPathInfo, animated?: boolean): void
102
103    replaceDestination(info: NavPathInfo, options?: NavigationOptions): Promise<void>
104    replacePathByName(name: string, param: Object, animated?: boolean): void
105    removeByIndexes(indexes: Array<number>): number
106    removeByName(name: string): number
107    removeByNavDestinationId(navDestinationId: string): boolean
108    pop(animated?: boolean): NavPathInfo | undefined
109
110    popToName(name: string, animated?: boolean): number
111
112    popToIndex(index: number, animated?: boolean): void
113
114    moveToTop(name: string, animated?: boolean): number
115    moveIndexToTop(index: number, animated?: boolean): void
116    clear(animated?: boolean): void
117    getAllPathName(): Array<string>
118    getParamByIndex(index: number): object | undefined
119    getParamByName(name: string): Array<object>
120    getIndexByName(name: string): Array<number>
121    getParent(): NavPathStack | undefined
122    size(): number
123    disableAnimation(value: boolean): void
124    setInterception(interception: NavigationInterception): void
125}
126export type NavBar = string;
127export type InterceptionShowCallback = (from:  NavBar, to: NavBar,
128    operation: NavigationOperation, isAnimated: boolean) => void;
129export type InterceptionModeCallback = (mode: NavigationMode) => void;
130export interface NavigationInterception {
131    willShow?: InterceptionShowCallback;
132    didShow?: InterceptionShowCallback;
133    modeChange?: InterceptionModeCallback;
134}
135export interface NavigationInterface {
136    invoke(): NavigationAttribute;
137
138}
139export enum ToolbarItemStatus {
140    NORMAL = 0,
141    DISABLED = 1,
142    ACTIVE = 2
143}
144export enum NavigationOperation {
145    PUSH = 1,
146    POP = 2,
147    REPLACE = 3
148}
149export interface ToolbarItem {
150    value: ResourceStr;
151    icon?: ResourceStr;
152    symbolIcon?: SymbolGlyphModifier;
153    action?: (() => void);
154    status?: ToolbarItemStatus;
155    activeIcon?: ResourceStr;
156    activeSymbolIcon?: SymbolGlyphModifier;
157}
158export interface NavigationTitleOptions {
159    backgroundColor?: ResourceColor;
160    backgroundBlurStyle?: BlurStyle;
161    barStyle?: BarStyle;
162    paddingStart?: LengthMetrics;
163    paddingEnd?: LengthMetrics;
164    mainTitleModifier?: TextModifier;
165    subTitleModifier?: TextModifier;
166    enableHoverMode?: boolean;
167}
168export enum BarStyle {
169    STANDARD = 0,
170    STACK = 1,
171    SAFE_AREA_PADDING = 2
172}
173export interface NavigationToolbarOptions {
174    backgroundColor?: ResourceColor;
175    backgroundBlurStyle?: BlurStyle;
176    barStyle?: BarStyle;
177}
178export type Tuple_Dimension_Dimension = [
179    Dimension,
180    Dimension
181]
182export type Callback_NavigationTitleMode_Void = (titleMode: NavigationTitleMode) => void;
183export type Callback_NavigationMode_Void = (mode: NavigationMode) => void;
184export type Callback_String_Unknown_Void = (name: string, param: object) => void;
185export type Type_NavigationAttribute_customNavContentTransition_delegate = (from: NavContentInfo, to: NavContentInfo,
186    operation: NavigationOperation) => NavigationAnimatedTransition | undefined;
187export interface NavigationAttribute extends CommonMethod {
188    @memo
189    navBarWidth(value: Length): this;
190    @memo
191    navBarPosition(value: NavBarPosition): this;
192    @memo
193    navBarWidthRange(value: [ Dimension, Dimension ]): this;
194    @memo
195    minContentWidth(value: Dimension): this;
196    @memo
197    mode(value: NavigationMode): this;
198    @memo
199    backButtonIcon(value: string | PixelMap | Resource | SymbolGlyphModifier): this;
200    @memo
201    hideNavBar(value: boolean): this;
202    @memo
203    subTitle(value: string): this;
204    @memo
205    hideTitleBar(value: boolean): this;
206    @memo
207    hideBackButton(value: boolean): this;
208    @memo
209    titleMode(value: NavigationTitleMode): this;
210    @memo
211    menus(value: Array<NavigationMenuItem> | CustomBuilder): this;
212    @memo
213    toolBar(value: Object | CustomBuilder): this;
214    @memo
215    hideToolBar(value: boolean): this;
216    @memo
217    onTitleModeChange(value: ((titleMode: NavigationTitleMode) => void)): this;
218    @memo
219    onNavBarStateChange(value: ((parameter: boolean) => void)): this;
220    @memo
221    onNavigationModeChange(value: ((mode: NavigationMode) => void)): this;
222    @memo
223    navDestination(value: ((name: string,param: object) => void)): this;
224    @memo
225        customNavContentTransition(value: ((from: NavContentInfo,to: NavContentInfo,
226        operation: NavigationOperation) => NavigationAnimatedTransition | undefined)): this;
227    @memo
228    systemBarStyle(value: SystemBarStyle | undefined): this;
229    @memo
230    recoverable(value: boolean | undefined): this;
231    @memo
232    enableDragBar(value: boolean | undefined): this;
233}
234export type Callback_NavigationTransitionProxy_Void = (transitionProxy: NavigationTransitionProxy) => void;
235export interface NavigationAnimatedTransition {
236    onTransitionEnd?: ((parameter: boolean) => void);
237    timeout?: number;
238    isInteractive?: boolean;
239    transition: ((transitionProxy: NavigationTransitionProxy) => void);
240}
241export interface NavigationTransitionProxy {
242    from: NavContentInfo;
243    to: NavContentInfo;
244    isInteractive?: boolean;
245    finishTransition(): void
246    cancelTransition(): void
247    updateTransition(progress: number): void
248}
249export interface NavContentInfo {
250    name?: string;
251    index: number;
252    param?: Object;
253    navDestinationId?: string;
254}
255