• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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 * Route jump.
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 7
22 */
23/**
24 * Route jump.
25 *
26 * @enum { number }
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @since 10
30 */
31declare enum NavigationType {
32  /**
33   * Jump to the next page.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 7
37   */
38  /**
39   * Jump to the next page.
40   *
41   * @syscap SystemCapability.ArkUI.ArkUI.Full
42   * @crossplatform
43   * @since 10
44   */
45  Push,
46
47  /**
48   * Return to the previous page.
49   *
50   * @syscap SystemCapability.ArkUI.ArkUI.Full
51   * @since 7
52   */
53  /**
54   * Return to the previous page.
55   *
56   * @syscap SystemCapability.ArkUI.ArkUI.Full
57   * @crossplatform
58   * @since 10
59   */
60  Back,
61
62  /**
63   * Replace page.
64   *
65   * @syscap SystemCapability.ArkUI.ArkUI.Full
66   * @since 7
67   */
68  /**
69   * Replace page.
70   *
71   * @syscap SystemCapability.ArkUI.ArkUI.Full
72   * @crossplatform
73   * @since 10
74   */
75  Replace,
76}
77
78/**
79 * Create route
80 *
81 * @interface NavigatorInterface
82 * @syscap SystemCapability.ArkUI.ArkUI.Full
83 * @since 7
84 */
85/**
86 * Create route
87 *
88 * @interface NavigatorInterface
89 * @syscap SystemCapability.ArkUI.ArkUI.Full
90 * @crossplatform
91 * @since 10
92 */
93interface NavigatorInterface {
94  /**
95   * Called when the route jumps.
96   *
97   * @param { object } value
98   * @returns { NavigatorAttribute }
99   * @syscap SystemCapability.ArkUI.ArkUI.Full
100   * @since 7
101   */
102  /**
103   * Called when the route jumps.
104   *
105   * @param { object } value
106   * @returns { NavigatorAttribute }
107   * @syscap SystemCapability.ArkUI.ArkUI.Full
108   * @crossplatform
109   * @since 10
110   */
111  (value?: { target: string; type?: NavigationType }): NavigatorAttribute;
112
113  /**
114   * Called when using the navigator.
115   *
116   * @returns { NavigatorAttribute }
117   * @syscap SystemCapability.ArkUI.ArkUI.Full
118   * @since 7
119   */
120  /**
121   * Called when using the navigator.
122   *
123   * @returns { NavigatorAttribute }
124   * @syscap SystemCapability.ArkUI.ArkUI.Full
125   * @crossplatform
126   * @since 10
127   */
128  (): NavigatorAttribute;
129}
130
131/**
132 * Declare navigator properties.
133 *
134 * @extends CommonMethod
135 * @syscap SystemCapability.ArkUI.ArkUI.Full
136 * @since 7
137 */
138/**
139 * Declare navigator properties.
140 *
141 * @extends CommonMethod
142 * @syscap SystemCapability.ArkUI.ArkUI.Full
143 * @crossplatform
144 * @since 10
145 */
146declare class NavigatorAttribute extends CommonMethod<NavigatorAttribute> {
147  /**
148   * Called when determining whether the routing component is active.
149   *
150   * @param { boolean } value
151   * @returns { NavigatorAttribute }
152   * @syscap SystemCapability.ArkUI.ArkUI.Full
153   * @since 7
154   */
155  /**
156   * Called when determining whether the routing component is active.
157   *
158   * @param { boolean } value
159   * @returns { NavigatorAttribute }
160   * @syscap SystemCapability.ArkUI.ArkUI.Full
161   * @crossplatform
162   * @since 10
163   */
164  active(value: boolean): NavigatorAttribute;
165
166  /**
167   * Called when determining whether the routing component is active.
168   *
169   * @param { NavigationType } value
170   * @returns { NavigatorAttribute }
171   * @syscap SystemCapability.ArkUI.ArkUI.Full
172   * @since 7
173   */
174  /**
175   * Called when determining whether the routing component is active.
176   *
177   * @param { NavigationType } value
178   * @returns { NavigatorAttribute }
179   * @syscap SystemCapability.ArkUI.ArkUI.Full
180   * @crossplatform
181   * @since 10
182   */
183  type(value: NavigationType): NavigatorAttribute;
184
185  /**
186   * Called when the path to the specified jump target page is set.
187   *
188   * @param { string } value
189   * @returns { NavigatorAttribute }
190   * @syscap SystemCapability.ArkUI.ArkUI.Full
191   * @since 7
192   */
193  /**
194   * Called when the path to the specified jump target page is set.
195   *
196   * @param { string } value
197   * @returns { NavigatorAttribute }
198   * @syscap SystemCapability.ArkUI.ArkUI.Full
199   * @crossplatform
200   * @since 10
201   */
202  target(value: string): NavigatorAttribute;
203
204  /**
205   * Called when data is passed to the target page at the same time during jump.
206   *
207   * @param { object } value
208   * @returns { NavigatorAttribute }
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @since 7
211   */
212  /**
213   * Called when data is passed to the target page at the same time during jump.
214   *
215   * @param { object } value
216   * @returns { NavigatorAttribute }
217   * @syscap SystemCapability.ArkUI.ArkUI.Full
218   * @crossplatform
219   * @since 10
220   */
221  params(value: object): NavigatorAttribute;
222}
223
224/**
225 * Defines Navigator Component.
226 *
227 * @syscap SystemCapability.ArkUI.ArkUI.Full
228 * @since 7
229 */
230/**
231 * Defines Navigator Component.
232 *
233 * @syscap SystemCapability.ArkUI.ArkUI.Full
234 * @crossplatform
235 * @since 10
236 */
237declare const Navigator: NavigatorInterface;
238
239/**
240 * Defines Navigator Component instance.
241 *
242 * @syscap SystemCapability.ArkUI.ArkUI.Full
243 * @since 7
244 */
245/**
246 * Defines Navigator Component instance.
247 *
248 * @syscap SystemCapability.ArkUI.ArkUI.Full
249 * @crossplatform
250 * @since 10
251 */
252declare const NavigatorInstance: NavigatorAttribute;
253