• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 * @file
18 * @kit ArkUI
19 */
20/*** if arkts 1.2 */
21import { NavPathStack, NavigationOperation, NavBar, ResourceStr } from '@ohos.arkui.component';
22import { UIContext } from '@ohos.arkui.UIContext';
23import UIAbilityContext from './application/UIAbilityContext';
24import { Callback } from './@ohos.base';
25/*** endif */
26
27/*** if arkts 1.1 */
28import type { Callback } from './@ohos.base';
29import type UIAbilityContext from './application/UIAbilityContext';
30import type { NavigationOperation, NavBar } from '../component/navigation';
31/*** endif */
32
33/**
34 * Register callbacks to observe ArkUI behavior.
35 *
36 * @namespace uiObserver
37 * @syscap SystemCapability.ArkUI.ArkUI.Full
38 * @crossplatform
39 * @since 11
40 */
41/**
42 * Register callbacks to observe ArkUI behavior.
43 *
44 * @namespace uiObserver
45 * @syscap SystemCapability.ArkUI.ArkUI.Full
46 * @crossplatform
47 * @atomicservice
48 * @since arkts {'1.1':'12','1.2':'20'}
49 * @arkts 1.1&1.2
50 */
51declare namespace uiObserver {
52  /**
53   * NavDestination state.
54   *
55   * @enum { number }
56   * @syscap SystemCapability.ArkUI.ArkUI.Full
57   * @crossplatform
58   * @since 11
59   */
60  /**
61   * NavDestination state.
62   *
63   * @enum { number }
64   * @syscap SystemCapability.ArkUI.ArkUI.Full
65   * @crossplatform
66   * @atomicservice
67   * @since arkts {'1.1':'12','1.2':'20'}
68   * @arkts 1.1&1.2
69   */
70  export enum NavDestinationState {
71    /**
72     * When the NavDestination is displayed.
73     *
74     * @syscap SystemCapability.ArkUI.ArkUI.Full
75     * @crossplatform
76     * @since 11
77     */
78    /**
79     * When the NavDestination is displayed.
80     *
81     * @syscap SystemCapability.ArkUI.ArkUI.Full
82     * @crossplatform
83     * @atomicservice
84     * @since arkts {'1.1':'12','1.2':'20'}
85     * @arkts 1.1&1.2
86     */
87    ON_SHOWN = 0,
88
89    /**
90     * When the NavDestination is hidden.
91     *
92     * @syscap SystemCapability.ArkUI.ArkUI.Full
93     * @crossplatform
94     * @since 11
95     */
96    /**
97     * When the NavDestination is hidden.
98     *
99     * @syscap SystemCapability.ArkUI.ArkUI.Full
100     * @crossplatform
101     * @atomicservice
102     * @since arkts {'1.1':'12','1.2':'20'}
103     * @arkts 1.1&1.2
104     */
105    ON_HIDDEN = 1,
106
107    /**
108     * When the NavDestination appear.
109     *
110     * @syscap SystemCapability.ArkUI.ArkUI.Full
111     * @crossplatform
112     * @atomicservice
113     * @since arkts {'1.1':'12','1.2':'20'}
114     * @arkts 1.1&1.2
115     */
116    ON_APPEAR = 2,
117
118    /**
119     * When the NavDestination disappear.
120     *
121     * @syscap SystemCapability.ArkUI.ArkUI.Full
122     * @crossplatform
123     * @atomicservice
124     * @since arkts {'1.1':'12','1.2':'20'}
125     * @arkts 1.1&1.2
126     */
127    ON_DISAPPEAR = 3,
128
129    /**
130     * Before the NavDestination is displayed.
131     *
132     * @syscap SystemCapability.ArkUI.ArkUI.Full
133     * @crossplatform
134     * @atomicservice
135     * @since arkts {'1.1':'12','1.2':'20'}
136     * @arkts 1.1&1.2
137     */
138    ON_WILL_SHOW = 4,
139
140    /**
141     * Before the NavDestination is hidden.
142     *
143     * @syscap SystemCapability.ArkUI.ArkUI.Full
144     * @crossplatform
145     * @atomicservice
146     * @since arkts {'1.1':'12','1.2':'20'}
147     * @arkts 1.1&1.2
148     */
149    ON_WILL_HIDE = 5,
150
151    /**
152     * Before the NavDestination is appeared.
153     *
154     * @syscap SystemCapability.ArkUI.ArkUI.Full
155     * @crossplatform
156     * @atomicservice
157     * @since arkts {'1.1':'12','1.2':'20'}
158     * @arkts 1.1&1.2
159     */
160    ON_WILL_APPEAR = 6,
161
162    /**
163     * Before the NavDestination is disappeared.
164     *
165     * @syscap SystemCapability.ArkUI.ArkUI.Full
166     * @crossplatform
167     * @atomicservice
168     * @since arkts {'1.1':'12','1.2':'20'}
169     * @arkts 1.1&1.2
170     */
171    ON_WILL_DISAPPEAR = 7,
172
173    /**
174     * When the NavDestination is active.
175     *
176     * @syscap SystemCapability.ArkUI.ArkUI.Full
177     * @crossplatform
178     * @atomicservice
179     * @since 17
180     */
181    ON_ACTIVE = 8,
182
183    /**
184     * When the NavDestination is inactive.
185     *
186     * @syscap SystemCapability.ArkUI.ArkUI.Full
187     * @crossplatform
188     * @atomicservice
189     * @since 17
190     */
191    ON_INACTIVE = 9,
192
193    /**
194     * When back press event happened in NavDestination.
195     *
196     * @syscap SystemCapability.ArkUI.ArkUI.Full
197     * @crossplatform
198     * @atomicservice
199     * @since arkts {'1.1':'12','1.2':'20'}
200     * @arkts 1.1&1.2
201     */
202    ON_BACKPRESS = 100
203  }
204
205  /**
206   * Router page state.
207   *
208   * @enum { number }
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @crossplatform
211   * @since 11
212   */
213  /**
214   * Router page state.
215   *
216   * @enum { number }
217   * @syscap SystemCapability.ArkUI.ArkUI.Full
218   * @crossplatform
219   * @atomicservice
220   * @since arkts {'1.1':'12','1.2':'20'}
221   * @arkts 1.1&1.2
222   */
223  export enum RouterPageState {
224    /**
225     * When the router page create.
226     *
227     * @syscap SystemCapability.ArkUI.ArkUI.Full
228     * @crossplatform
229     * @since 11
230     */
231    /**
232     * When the router page create.
233     *
234     * @syscap SystemCapability.ArkUI.ArkUI.Full
235     * @crossplatform
236     * @atomicservice
237     * @since arkts {'1.1':'12','1.2':'20'}
238     * @arkts 1.1&1.2
239     */
240    ABOUT_TO_APPEAR = 0,
241
242    /**
243     * When the router page destroy.
244     *
245     * @syscap SystemCapability.ArkUI.ArkUI.Full
246     * @crossplatform
247     * @since 11
248     */
249    /**
250     * When the router page destroy.
251     *
252     * @syscap SystemCapability.ArkUI.ArkUI.Full
253     * @crossplatform
254     * @atomicservice
255     * @since arkts {'1.1':'12','1.2':'20'}
256     * @arkts 1.1&1.2
257     */
258    ABOUT_TO_DISAPPEAR = 1,
259
260    /**
261     * When the router page show.
262     *
263     * @syscap SystemCapability.ArkUI.ArkUI.Full
264     * @crossplatform
265     * @since 11
266     */
267    /**
268     * When the router page show.
269     *
270     * @syscap SystemCapability.ArkUI.ArkUI.Full
271     * @crossplatform
272     * @atomicservice
273     * @since arkts {'1.1':'12','1.2':'20'}
274     * @arkts 1.1&1.2
275     */
276    ON_PAGE_SHOW = 2,
277
278    /**
279     * When the router page hide.
280     *
281     * @syscap SystemCapability.ArkUI.ArkUI.Full
282     * @crossplatform
283     * @since 11
284     */
285    /**
286     * When the router page hide.
287     *
288     * @syscap SystemCapability.ArkUI.ArkUI.Full
289     * @crossplatform
290     * @atomicservice
291     * @since arkts {'1.1':'12','1.2':'20'}
292     * @arkts 1.1&1.2
293     */
294    ON_PAGE_HIDE = 3,
295
296    /**
297     * When back press event happened in the router page.
298     *
299     * @syscap SystemCapability.ArkUI.ArkUI.Full
300     * @crossplatform
301     * @since 11
302     */
303    /**
304     * When back press event happened in the router page.
305     *
306     * @syscap SystemCapability.ArkUI.ArkUI.Full
307     * @crossplatform
308     * @atomicservice
309     * @since arkts {'1.1':'12','1.2':'20'}
310     * @arkts 1.1&1.2
311     */
312    ON_BACK_PRESS = 4
313  }
314
315  /**
316   * ScrollEvent type.
317   *
318   * @enum { number }
319   * @syscap SystemCapability.ArkUI.ArkUI.Full
320   * @crossplatform
321   * @atomicservice
322   * @since arkts {'1.1':'12','1.2':'20'}
323   * @arkts 1.1&1.2
324   */
325    export enum ScrollEventType {
326      /**
327       * When the ScrollEvent start.
328       *
329       * @syscap SystemCapability.ArkUI.ArkUI.Full
330       * @crossplatform
331       * @atomicservice
332       * @since arkts {'1.1':'12','1.2':'20'}
333       * @arkts 1.1&1.2
334       */
335      SCROLL_START = 0,
336
337      /**
338       * When the ScrollEvent stop.
339       *
340       * @syscap SystemCapability.ArkUI.ArkUI.Full
341       * @crossplatform
342       * @atomicservice
343       * @since arkts {'1.1':'12','1.2':'20'}
344       * @arkts 1.1&1.2
345       */
346      SCROLL_STOP = 1
347    }
348
349  /**
350   * TabContent state.
351   *
352   * @enum { number }
353   * @syscap SystemCapability.ArkUI.ArkUI.Full
354   * @crossplatform
355   * @atomicservice
356   * @since arkts {'1.1':'12','1.2':'20'}
357   * @arkts 1.1&1.2
358   */
359  export enum TabContentState {
360    /**
361     * When the TabContent hidden.
362     *
363     * @syscap SystemCapability.ArkUI.ArkUI.Full
364     * @crossplatform
365     * @atomicservice
366     * @since arkts {'1.1':'12','1.2':'20'}
367     * @arkts 1.1&1.2
368     */
369    ON_SHOW = 0,
370
371    /**
372     * When the TabContent hidden.
373     *
374     * @syscap SystemCapability.ArkUI.ArkUI.Full
375     * @crossplatform
376     * @atomicservice
377     * @since arkts {'1.1':'12','1.2':'20'}
378     * @arkts 1.1&1.2
379     */
380    ON_HIDE = 1
381  }
382
383  /**
384   * NavDestination info.
385   *
386   * @interface NavDestinationInfo
387   * @syscap SystemCapability.ArkUI.ArkUI.Full
388   * @crossplatform
389   * @since 11
390   */
391  /**
392   * NavDestination info.
393   *
394   * @interface NavDestinationInfo
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @crossplatform
397   * @atomicservice
398   * @since arkts {'1.1':'12','1.2':'20'}
399   * @arkts 1.1&1.2
400   */
401  export interface NavDestinationInfo {
402    /**
403     * Navigation id.
404     *
405     * @type { ResourceStr }
406     * @syscap SystemCapability.ArkUI.ArkUI.Full
407     * @crossplatform
408     * @since 11
409     */
410    /**
411     * Navigation id.
412     *
413     * @type { ResourceStr }
414     * @syscap SystemCapability.ArkUI.ArkUI.Full
415     * @crossplatform
416     * @atomicservice
417     * @since arkts {'1.1':'12','1.2':'20'}
418     * @arkts 1.1&1.2
419     */
420    navigationId: ResourceStr,
421
422    /**
423     * Changed NavDestination name.
424     *
425     * @type { ResourceStr }
426     * @syscap SystemCapability.ArkUI.ArkUI.Full
427     * @crossplatform
428     * @since 11
429     */
430    /**
431     * Changed NavDestination name.
432     *
433     * @type { ResourceStr }
434     * @syscap SystemCapability.ArkUI.ArkUI.Full
435     * @crossplatform
436     * @atomicservice
437     * @since arkts {'1.1':'12','1.2':'20'}
438     * @arkts 1.1&1.2
439     */
440    name: ResourceStr,
441
442    /**
443     * Changed NavDestination state.
444     *
445     * @type { NavDestinationState }
446     * @syscap SystemCapability.ArkUI.ArkUI.Full
447     * @crossplatform
448     * @since 11
449     */
450    /**
451     * Changed NavDestination state.
452     *
453     * @type { NavDestinationState }
454     * @syscap SystemCapability.ArkUI.ArkUI.Full
455     * @crossplatform
456     * @atomicservice
457     * @since arkts {'1.1':'12','1.2':'20'}
458     * @arkts 1.1&1.2
459     */
460    state: NavDestinationState,
461
462    /**
463     * NavDestination index.
464     *
465     * @type { number }
466     * @syscap SystemCapability.ArkUI.ArkUI.Full
467     * @crossplatform
468     * @atomicservice
469     * @since arkts {'1.1':'12','1.2':'20'}
470     * @arkts 1.1&1.2
471     */
472    index: number;
473
474    /**
475     * The detailed parameter of NavDestination.
476     *
477     * @type { ?Object }
478     * @syscap SystemCapability.ArkUI.ArkUI.Full
479     * @crossplatform
480     * @atomicservice
481     * @since arkts {'1.1':'12','1.2':'20'}
482     * @arkts 1.1&1.2
483     */
484    param?: Object;
485
486    /**
487     * Auto-generated navDestination id, which is different from common property id of Component.
488     *
489     * @type { string }
490     * @syscap SystemCapability.ArkUI.ArkUI.Full
491     * @crossplatform
492     * @atomicservice
493     * @since arkts {'1.1':'12','1.2':'20'}
494     * @arkts 1.1&1.2
495     */
496    navDestinationId: string;
497
498    /**
499     * NavDestination mode.
500     *
501     * @type { NavDestinationMode }
502     * @syscap SystemCapability.ArkUI.ArkUI.Full
503     * @crossplatform
504     * @atomicservice
505     * @since 15
506     */
507    mode?: NavDestinationMode;
508
509    /**
510     * NavDestination uniqueId.
511     *
512     * @type { number }
513     * @syscap SystemCapability.ArkUI.ArkUI.Full
514     * @crossplatform
515     * @atomicservice
516     * @since 15
517     */
518    uniqueId?: number;
519  }
520
521  /**
522   * Navigation info.
523   *
524   * @interface NavigationInfo
525   * @syscap SystemCapability.ArkUI.ArkUI.Full
526   * @crossplatform
527   * @atomicservice
528   * @since arkts {'1.1':'12','1.2':'20'}
529   * @arkts 1.1&1.2
530   */
531  export interface NavigationInfo {
532    /**
533     * Navigation id.
534     *
535     * @type { string }
536     * @syscap SystemCapability.ArkUI.ArkUI.Full
537     * @crossplatform
538     * @atomicservice
539     * @since arkts {'1.1':'12','1.2':'20'}
540     * @arkts 1.1&1.2
541     */
542    navigationId: string;
543
544    /**
545     * Navigation path stack.
546     *
547     * @type { NavPathStack }
548     * @syscap SystemCapability.ArkUI.ArkUI.Full
549     * @crossplatform
550     * @atomicservice
551     * @since arkts {'1.1':'12','1.2':'20'}
552     * @arkts 1.1&1.2
553     */
554    pathStack: NavPathStack;
555
556    /**
557     * The uniqueId of the navigation.
558     *
559     * @type { ?number }
560     * @syscap SystemCapability.ArkUI.ArkUI.Full
561     * @crossplatform
562     * @atomicservice
563     * @since 20
564     */
565    uniqueId?: number;
566  }
567
568  /**
569   * ScrollEvent info.
570   *
571   * @interface ScrollEventInfo
572   * @syscap SystemCapability.ArkUI.ArkUI.Full
573   * @crossplatform
574   * @atomicservice
575   * @since arkts {'1.1':'12','1.2':'20'}
576   * @arkts 1.1&1.2
577   */
578  export interface ScrollEventInfo {
579    /**
580     * Scroll id.
581     *
582     * @type { string }
583     * @syscap SystemCapability.ArkUI.ArkUI.Full
584     * @crossplatform
585     * @atomicservice
586     * @since arkts {'1.1':'12','1.2':'20'}
587     * @arkts 1.1&1.2
588     */
589    id: string,
590
591    /**
592     * The uniqueId of the scrollable component.
593     *
594     * @type { number }
595     * @syscap SystemCapability.ArkUI.ArkUI.Full
596     * @crossplatform
597     * @atomicservice
598     * @since arkts {'1.1':'12','1.2':'20'}
599     * @arkts 1.1&1.2
600     */
601    uniqueId: number,
602
603    /**
604     * Changed ScrollEvent type.
605     *
606     * @type { ScrollEventType }
607     * @syscap SystemCapability.ArkUI.ArkUI.Full
608     * @crossplatform
609     * @atomicservice
610     * @since arkts {'1.1':'12','1.2':'20'}
611     * @arkts 1.1&1.2
612     */
613    scrollEvent: ScrollEventType,
614
615    /**
616     * Changed ScrollEvent offset.
617     *
618     * @type { number }
619     * @syscap SystemCapability.ArkUI.ArkUI.Full
620     * @crossplatform
621     * @atomicservice
622     * @since arkts {'1.1':'12','1.2':'20'}
623     * @arkts 1.1&1.2
624     */
625    offset: number,
626
627    /**
628     * Scroll axis.
629     *
630     * @type { ?Axis }
631     * @syscap SystemCapability.ArkUI.ArkUI.Full
632     * @crossplatform
633     * @atomicservice
634     * @since 20
635     */
636    axis?: Axis
637  }
638
639  /**
640   * TabContent info.
641   *
642   * @typedef TabContentInfo
643   * @syscap SystemCapability.ArkUI.ArkUI.Full
644   * @crossplatform
645   * @atomicservice
646   * @since arkts {'1.1':'12','1.2':'20'}
647   * @arkts 1.1&1.2
648   */
649  export interface TabContentInfo {
650    /**
651     * TabContent id.
652     *
653     * @type { string }
654     * @syscap SystemCapability.ArkUI.ArkUI.Full
655     * @crossplatform
656     * @atomicservice
657     * @since arkts {'1.1':'12','1.2':'20'}
658     * @arkts 1.1&1.2
659     */
660    tabContentId: string,
661
662    /**
663     * TabContent uniqueId.
664     *
665     * @type { number }
666     * @syscap SystemCapability.ArkUI.ArkUI.Full
667     * @crossplatform
668     * @atomicservice
669     * @since arkts {'1.1':'12','1.2':'20'}
670     * @arkts 1.1&1.2
671     */
672    tabContentUniqueId: number,
673
674    /**
675     * The state of TabContent.
676     *
677     * @type { TabContentState }
678     * @syscap SystemCapability.ArkUI.ArkUI.Full
679     * @crossplatform
680     * @atomicservice
681     * @since arkts {'1.1':'12','1.2':'20'}
682     * @arkts 1.1&1.2
683     */
684    state: TabContentState,
685
686    /**
687     * The index of TabContent in Tabs.
688     *
689     * @type { number }
690     * @syscap SystemCapability.ArkUI.ArkUI.Full
691     * @crossplatform
692     * @atomicservice
693     * @since arkts {'1.1':'12','1.2':'20'}
694     * @arkts 1.1&1.2
695     */
696    index: number,
697
698    /**
699     * Tabs id.
700     *
701     * @type { string }
702     * @syscap SystemCapability.ArkUI.ArkUI.Full
703     * @crossplatform
704     * @atomicservice
705     * @since arkts {'1.1':'12','1.2':'20'}
706     * @arkts 1.1&1.2
707     */
708    id: string,
709
710    /**
711     * Tabs uniqueId.
712     *
713     * @type { number }
714     * @syscap SystemCapability.ArkUI.ArkUI.Full
715     * @crossplatform
716     * @atomicservice
717     * @since arkts {'1.1':'12','1.2':'20'}
718     * @arkts 1.1&1.2
719     */
720    uniqueId: number
721  }
722
723    /**
724     * observer options.
725     *
726     * @interface ObserverOptions
727     * @syscap SystemCapability.ArkUI.ArkUI.Full
728     * @crossplatform
729     * @atomicservice
730     * @since arkts {'1.1':'12','1.2':'20'}
731     * @arkts 1.1&1.2
732     */
733    export interface ObserverOptions {
734      /**
735       * component id.
736       *
737       * @type { string }
738       * @syscap SystemCapability.ArkUI.ArkUI.Full
739       * @crossplatform
740       * @atomicservice
741       * @since arkts {'1.1':'12','1.2':'20'}
742       * @arkts 1.1&1.2
743       */
744      id: string
745    }
746
747  /**
748   * Router page info.
749   *
750   * @syscap SystemCapability.ArkUI.ArkUI.Full
751   * @crossplatform
752   * @since 11
753   */
754  /**
755   * Router page info.
756   *
757   * @syscap SystemCapability.ArkUI.ArkUI.Full
758   * @crossplatform
759   * @atomicservice
760   * @since arkts {'1.1':'12','1.2':'20'}
761   * @arkts 1.1&1.2
762   */
763  export class RouterPageInfo {
764    /**
765     * The context of the changed router page.
766     *
767     * @type { UIAbilityContext | UIContext }
768     * @syscap SystemCapability.ArkUI.ArkUI.Full
769     * @crossplatform
770     * @since 11
771     */
772    /**
773     * The context of the changed router page.
774     *
775     * @type { UIAbilityContext | UIContext }
776     * @syscap SystemCapability.ArkUI.ArkUI.Full
777     * @crossplatform
778     * @atomicservice
779     * @since arkts {'1.1':'12','1.2':'20'}
780     * @arkts 1.1&1.2
781     */
782    context: UIAbilityContext | UIContext;
783
784    /**
785     * The index of the changed router page in router stack.
786     *
787     * @type { number }
788     * @syscap SystemCapability.ArkUI.ArkUI.Full
789     * @crossplatform
790     * @since 11
791     */
792    /**
793     * The index of the changed router page in router stack.
794     *
795     * @type { number }
796     * @syscap SystemCapability.ArkUI.ArkUI.Full
797     * @crossplatform
798     * @atomicservice
799     * @since arkts {'1.1':'12','1.2':'20'}
800     * @arkts 1.1&1.2
801     */
802    index: number;
803
804    /**
805     * The name of the changed router page.
806     *
807     * @type { string }
808     * @syscap SystemCapability.ArkUI.ArkUI.Full
809     * @crossplatform
810     * @since 11
811     */
812    /**
813     * The name of the changed router page.
814     *
815     * @type { string }
816     * @syscap SystemCapability.ArkUI.ArkUI.Full
817     * @crossplatform
818     * @atomicservice
819     * @since arkts {'1.1':'12','1.2':'20'}
820     * @arkts 1.1&1.2
821     */
822    name: string;
823
824    /**
825     * The path of the changed router page.
826     *
827     * @type { string }
828     * @syscap SystemCapability.ArkUI.ArkUI.Full
829     * @crossplatform
830     * @since 11
831     */
832    /**
833     * The path of the changed router page.
834     *
835     * @type { string }
836     * @syscap SystemCapability.ArkUI.ArkUI.Full
837     * @crossplatform
838     * @atomicservice
839     * @since arkts {'1.1':'12','1.2':'20'}
840     * @arkts 1.1&1.2
841     */
842    path: string;
843
844    /**
845     * The state of the changed router page.
846     *
847     * @type { RouterPageState }
848     * @syscap SystemCapability.ArkUI.ArkUI.Full
849     * @crossplatform
850     * @since 11
851     */
852    /**
853     * The state of the changed router page.
854     *
855     * @type { RouterPageState }
856     * @syscap SystemCapability.ArkUI.ArkUI.Full
857     * @crossplatform
858     * @atomicservice
859     * @since arkts {'1.1':'12','1.2':'20'}
860     * @arkts 1.1&1.2
861     */
862    state: RouterPageState;
863
864    /**
865     * The unique identifier of the router page.
866     *
867     * @type { string }
868     * @syscap SystemCapability.ArkUI.ArkUI.Full
869     * @crossplatform
870     * @atomicservice
871     * @since arkts {'1.1':'12','1.2':'20'}
872     * @arkts 1.1&1.2
873     */
874     pageId: string;
875  }
876
877  /**
878   * Density info.
879   *
880   * @syscap SystemCapability.ArkUI.ArkUI.Full
881   * @crossplatform
882   * @atomicservice
883   * @since arkts {'1.1':'12','1.2':'20'}
884   * @arkts 1.1&1.2
885   */
886  export class DensityInfo {
887    /**
888     * The context of the changed screen density.
889     *
890     * @type { UIContext }
891     * @syscap SystemCapability.ArkUI.ArkUI.Full
892     * @crossplatform
893     * @atomicservice
894     * @since arkts {'1.1':'12','1.2':'20'}
895     * @arkts 1.1&1.2
896     */
897    context: UIContext;
898
899    /**
900     * The changed screen density.
901     *
902     * @type { number }
903     * @syscap SystemCapability.ArkUI.ArkUI.Full
904     * @crossplatform
905     * @atomicservice
906     * @since arkts {'1.1':'12','1.2':'20'}
907     * @arkts 1.1&1.2
908     */
909    density: number;
910  }
911
912  /**
913   * NavDestination switch info
914   *
915   * @interface NavDestinationSwitchInfo
916   * @syscap SystemCapability.ArkUI.ArkUI.Full
917   * @crossplatform
918   * @atomicservice
919   * @since arkts {'1.1':'12','1.2':'20'}
920   * @arkts 1.1&1.2
921   */
922  export interface NavDestinationSwitchInfo {
923    /**
924     * The context of the navigation operation.
925     *
926     * @type { UIAbilityContext | UIContext }
927     * @syscap SystemCapability.ArkUI.ArkUI.Full
928     * @crossplatform
929     * @atomicservice
930     * @since arkts {'1.1':'12','1.2':'20'}
931     * @arkts 1.1&1.2
932     */
933    context: UIAbilityContext | UIContext;
934
935    /**
936     * From navigation content info.
937     *
938     * @type { NavDestinationInfo | NavBar }
939     * @syscap SystemCapability.ArkUI.ArkUI.Full
940     * @crossplatform
941     * @atomicservice
942     * @since arkts {'1.1':'12','1.2':'20'}
943     * @arkts 1.1&1.2
944     */
945    from: NavDestinationInfo | NavBar;
946
947    /**
948     * To navigation content info.
949     *
950     * @type { NavDestinationInfo | NavBar }
951     * @syscap SystemCapability.ArkUI.ArkUI.Full
952     * @crossplatform
953     * @atomicservice
954     * @since arkts {'1.1':'12','1.2':'20'}
955     * @arkts 1.1&1.2
956     */
957    to: NavDestinationInfo | NavBar;
958
959    /**
960     * The operation type.
961     *
962     * @type { NavigationOperation }
963     * @syscap SystemCapability.ArkUI.ArkUI.Full
964     * @crossplatform
965     * @atomicservice
966     * @since arkts {'1.1':'12','1.2':'20'}
967     * @arkts 1.1&1.2
968     */
969    operation: NavigationOperation;
970  }
971
972  /**
973   * Indicates the options of NavDestination switch.
974   *
975   * @interface NavDestinationSwitchObserverOptions
976   * @syscap SystemCapability.ArkUI.ArkUI.Full
977   * @crossplatform
978   * @atomicservice
979   * @since arkts {'1.1':'12','1.2':'20'}
980   * @arkts 1.1&1.2
981   */
982  export interface NavDestinationSwitchObserverOptions {
983    /**
984     * The navigationId that need observation
985     *
986     * @type { ResourceStr }
987     * @syscap SystemCapability.ArkUI.ArkUI.Full
988     * @crossplatform
989     * @atomicservice
990     * @since arkts {'1.1':'12','1.2':'20'}
991     * @arkts 1.1&1.2
992     */
993    navigationId: ResourceStr;
994  }
995
996  /**
997   * Registers a callback function to be called when the navigation destination is updated.
998   *
999   * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'.
1000   * @param { object } options - The options object.
1001   * @param { Callback<NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated.
1002   * @syscap SystemCapability.ArkUI.ArkUI.Full
1003   * @crossplatform
1004   * @since 11
1005   */
1006  /**
1007   * Registers a callback function to be called when the navigation destination is updated.
1008   *
1009   * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'.
1010   * @param { object } options - The options object.
1011   * @param { Callback<NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated.
1012   * @syscap SystemCapability.ArkUI.ArkUI.Full
1013   * @crossplatform
1014   * @atomicservice
1015   * @since 12
1016   */
1017  export function on(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback: Callback<NavDestinationInfo>): void;
1018
1019  /**
1020   * Registers a callback function to be called when the navigation destination is updated.
1021   *
1022   * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'.
1023   * @param { NavDestinationSwitchObserverOptions } options - The options object.
1024   * @param { Callback<NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated.
1025   * @syscap SystemCapability.ArkUI.ArkUI.Full
1026   * @crossplatform
1027   * @atomicservice
1028   * @since 20
1029   * @arkts 1.2
1030   */
1031  export function on(type: 'navDestinationUpdate', options: NavDestinationSwitchObserverOptions, callback: Callback<NavDestinationInfo>): void;
1032
1033  /**
1034   * Removes a callback function that was previously registered with `on()`.
1035   *
1036   * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'.
1037   * @param { object } options - The options object.
1038   * @param { Callback<NavDestinationInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and
1039   *                                                    navigation ID will be removed.
1040   * @syscap SystemCapability.ArkUI.ArkUI.Full
1041   * @crossplatform
1042   * @since 11
1043   */
1044  /**
1045   * Removes a callback function that was previously registered with `on()`.
1046   *
1047   * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'.
1048   * @param { object } options - The options object.
1049   * @param { Callback<NavDestinationInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and
1050   *                                                    navigation ID will be removed.
1051   * @syscap SystemCapability.ArkUI.ArkUI.Full
1052   * @crossplatform
1053   * @atomicservice
1054   * @since 12
1055   */
1056  export function off(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callback?: Callback<NavDestinationInfo>): void;
1057
1058  /**
1059   * Removes a callback function that was previously registered with `on()`.
1060   *
1061   * @param { 'navDestinationUpdate' } type - The type of event to remove the listener for. Must be 'navDestinationUpdate'.
1062   * @param { NavDestinationSwitchObserverOptions } options - The options object.
1063   * @param { Callback<NavDestinationInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and
1064   *                                                    navigation ID will be removed.
1065   * @syscap SystemCapability.ArkUI.ArkUI.Full
1066   * @crossplatform
1067   * @atomicservice
1068   * @since 20
1069   * @arkts 1.2
1070   */
1071  export function off(type: 'navDestinationUpdate', options: NavDestinationSwitchObserverOptions, callback?: Callback<NavDestinationInfo>): void;
1072
1073  /**
1074   * Registers a callback function to be called when the navigation destination is updated.
1075   *
1076   * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'.
1077   * @param { Callback<NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated.
1078   * @syscap SystemCapability.ArkUI.ArkUI.Full
1079   * @crossplatform
1080   * @since 11
1081   */
1082  /**
1083   * Registers a callback function to be called when the navigation destination is updated.
1084   *
1085   * @param { 'navDestinationUpdate' } type - The type of event to listen for. Must be 'navDestinationUpdate'.
1086   * @param { Callback<NavDestinationInfo> } callback - The callback function to be called when the navigation destination is updated.
1087   * @syscap SystemCapability.ArkUI.ArkUI.Full
1088   * @crossplatform
1089   * @atomicservice
1090   * @since arkts {'1.1':'12','1.2':'20'}
1091   * @arkts 1.1&1.2
1092   */
1093  export function on(type: 'navDestinationUpdate', callback: Callback<NavDestinationInfo>): void;
1094
1095  /**
1096   * Removes a callback function that was previously registered with `on()`.
1097   *
1098   * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'.
1099   * @param { Callback<NavDestinationInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1100   *                                                      will be removed.
1101   * @syscap SystemCapability.ArkUI.ArkUI.Full
1102   * @crossplatform
1103   * @since 11
1104   */
1105  /**
1106   * Removes a callback function that was previously registered with `on()`.
1107   *
1108   * @param { 'navDestinationUpdate'} type - The type of event to remove the listener for. Must be 'navDestinationUpdate'.
1109   * @param { Callback<NavDestinationInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1110   *                                                      will be removed.
1111   * @syscap SystemCapability.ArkUI.ArkUI.Full
1112   * @crossplatform
1113   * @atomicservice
1114   * @since arkts {'1.1':'12','1.2':'20'}
1115   * @arkts 1.1&1.2
1116   */
1117  export function off(type: 'navDestinationUpdate', callback?: Callback<NavDestinationInfo>): void;
1118
1119  /**
1120   * Registers a callback function to be called when the scroll event start or stop.
1121   *
1122   * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'.
1123   * @param { ObserverOptions } options - The options object.
1124   * @param { Callback<ScrollEventInfo> } callback - The callback function to be called when the scroll event start or stop.
1125   * @syscap SystemCapability.ArkUI.ArkUI.Full
1126   * @crossplatform
1127   * @atomicservice
1128   * @since arkts {'1.1':'12','1.2':'20'}
1129   * @arkts 1.1&1.2
1130   */
1131  export function on(type: 'scrollEvent', options: ObserverOptions, callback: Callback<ScrollEventInfo>): void;
1132
1133  /**
1134   * Removes a callback function that was previously registered with `on()`.
1135   *
1136   * @param { 'scrollEvent' } type - The type of event to remove the listener for. Must be 'scrollEvent'.
1137   * @param { ObserverOptions } options - The options object.
1138   * @param { Callback<ScrollEventInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and
1139   *                                                    scroll ID will be removed.
1140   * @syscap SystemCapability.ArkUI.ArkUI.Full
1141   * @crossplatform
1142   * @atomicservice
1143   * @since arkts {'1.1':'12','1.2':'20'}
1144   * @arkts 1.1&1.2
1145   */
1146  export function off(type: 'scrollEvent', options: ObserverOptions, callback?: Callback<ScrollEventInfo>): void;
1147
1148  /**
1149   * Registers a callback function to be called when the scroll event start or stop.
1150   *
1151   * @param { 'scrollEvent' } type - The type of event to listen for. Must be 'scrollEvent'.
1152   * @param { Callback<ScrollEventInfo> } callback - The callback function to be called when the scroll event start or stop.
1153   * @syscap SystemCapability.ArkUI.ArkUI.Full
1154   * @crossplatform
1155   * @atomicservice
1156   * @since arkts {'1.1':'12','1.2':'20'}
1157   * @arkts 1.1&1.2
1158   */
1159  export function on(type: 'scrollEvent', callback: Callback<ScrollEventInfo>): void;
1160
1161  /**
1162   * Removes a callback function that was previously registered with `on()`.
1163   *
1164   * @param { 'scrollEvent'} type - The type of event to remove the listener for. Must be 'scrollEvent'.
1165   * @param { Callback<ScrollEventInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1166   *                                                      will be removed.
1167   * @syscap SystemCapability.ArkUI.ArkUI.Full
1168   * @crossplatform
1169   * @atomicservice
1170   * @since arkts {'1.1':'12','1.2':'20'}
1171   * @arkts 1.1&1.2
1172   */
1173  export function off(type: 'scrollEvent', callback?: Callback<ScrollEventInfo>): void;
1174
1175  /**
1176   * Registers a callback function to be called when the router page is updated.
1177   *
1178   * @param { 'routerPageUpdate' } type - The type of event to listen for. Must be 'routerPageUpdate'.
1179   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1180   * @param { Callback<RouterPageInfo> } callback - The callback function to be called when the router page is updated.
1181   * @syscap SystemCapability.ArkUI.ArkUI.Full
1182   * @crossplatform
1183   * @since 11
1184   */
1185  /**
1186   * Registers a callback function to be called when the router page is updated.
1187   *
1188   * @param { 'routerPageUpdate' } type - The type of event to listen for. Must be 'routerPageUpdate'.
1189   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1190   * @param { Callback<RouterPageInfo> } callback - The callback function to be called when the router page is updated.
1191   * @syscap SystemCapability.ArkUI.ArkUI.Full
1192   * @crossplatform
1193   * @atomicservice
1194   * @since arkts {'1.1':'12','1.2':'20'}
1195   * @arkts 1.1&1.2
1196   */
1197  export function on(type: 'routerPageUpdate', context: UIAbilityContext | UIContext, callback: Callback<RouterPageInfo>): void;
1198
1199  /**
1200   * Removes a callback function that was previously registered with `on()`.
1201   *
1202   * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'.
1203   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1204   * @param { Callback<RouterPageInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1205   *                                                               will be removed.
1206   * @syscap SystemCapability.ArkUI.ArkUI.Full
1207   * @crossplatform
1208   * @since 11
1209   */
1210  /**
1211   * Removes a callback function that was previously registered with `on()`.
1212   *
1213   * @param { 'routerPageUpdate' } type - The type of event to remove the listener for. Must be 'routerPageUpdate'.
1214   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1215   * @param { Callback<RouterPageInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1216   *                                                               will be removed.
1217   * @syscap SystemCapability.ArkUI.ArkUI.Full
1218   * @crossplatform
1219   * @atomicservice
1220   * @since arkts {'1.1':'12','1.2':'20'}
1221   * @arkts 1.1&1.2
1222   */
1223  export function off(type: 'routerPageUpdate', context: UIAbilityContext | UIContext, callback?: Callback<RouterPageInfo>): void;
1224
1225  /**
1226   * Registers a callback function to be called when the screen density is updated.
1227   *
1228   * @param { 'densityUpdate' } type - The type of event to listen for. Must be 'densityUpdate'.
1229   * @param { UIContext } context - The context scope of the observer.
1230   * @param { Callback<DensityInfo> } callback - The callback function to be called when the screen density is updated.
1231   * @syscap SystemCapability.ArkUI.ArkUI.Full
1232   * @crossplatform
1233   * @atomicservice
1234   * @since arkts {'1.1':'12','1.2':'20'}
1235   * @arkts 1.1&1.2
1236   */
1237  export function on(type: 'densityUpdate', context: UIContext, callback: Callback<DensityInfo>): void;
1238
1239  /**
1240   * Removes a callback function that was previously registered with `on()`.
1241   *
1242   * @param { 'densityUpdate' } type - The type of event to remove the listener for. Must be 'densityUpdate'.
1243   * @param { UIContext } context - The context scope of the observer.
1244   * @param { Callback<DensityInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1245   *                                               will be removed.
1246   * @syscap SystemCapability.ArkUI.ArkUI.Full
1247   * @crossplatform
1248   * @atomicservice
1249   * @since arkts {'1.1':'12','1.2':'20'}
1250   * @arkts 1.1&1.2
1251   */
1252  export function off(type: 'densityUpdate', context: UIContext, callback?: Callback<DensityInfo>): void;
1253
1254  /**
1255   * Registers a callback function to be called when the draw command will be drawn.
1256   *
1257   * @param { 'willDraw' } type - The type of event to listen for. Must be 'willDraw'.
1258   * @param { UIContext } context - The context scope of the observer.
1259   * @param { Callback<void> } callback - The callback function to be called when the draw command will be drawn.
1260   * @syscap SystemCapability.ArkUI.ArkUI.Full
1261   * @crossplatform
1262   * @atomicservice
1263   * @since arkts {'1.1':'12','1.2':'20'}
1264   * @arkts 1.1&1.2
1265   */
1266  export function on(type: 'willDraw', context: UIContext, callback: Callback<void>): void;
1267
1268  /**
1269   * Removes a callback function that was previously registered with `on()`.
1270   *
1271   * @param { 'willDraw' } type - The type of event to remove the listener for. Must be 'willDraw'.
1272   * @param { UIContext } context - The context scope of the observer.
1273   * @param { Callback<void> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1274   *                                               will be removed.
1275   * @syscap SystemCapability.ArkUI.ArkUI.Full
1276   * @crossplatform
1277   * @atomicservice
1278   * @since arkts {'1.1':'12','1.2':'20'}
1279   * @arkts 1.1&1.2
1280   */
1281  export function off(type: 'willDraw', context: UIContext, callback?: Callback<void>): void;
1282
1283  /**
1284   * Registers a callback function to be called when the layout is done.
1285   *
1286   * @param { 'didLayout' } type - The type of event to listen for. Must be 'didLayout'.
1287   * @param { UIContext } context - The context scope of the observer.
1288   * @param { Callback<void> } callback - The callback function to be called when the layout is done.
1289   * @syscap SystemCapability.ArkUI.ArkUI.Full
1290   * @crossplatform
1291   * @atomicservice
1292   * @since arkts {'1.1':'12','1.2':'20'}
1293   * @arkts 1.1&1.2
1294   */
1295  export function on(type: 'didLayout', context: UIContext, callback: Callback<void>): void;
1296
1297  /**
1298   * Removes a callback function that was previously registered with `on()`.
1299   *
1300   * @param { 'didLayout' } type - The type of event to remove the listener for. Must be 'didLayout'.
1301   * @param { UIContext } context - The context scope of the observer.
1302   * @param { Callback<void> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1303   *                                               will be removed.
1304   * @syscap SystemCapability.ArkUI.ArkUI.Full
1305   * @crossplatform
1306   * @atomicservice
1307   * @since arkts {'1.1':'12','1.2':'20'}
1308   * @arkts 1.1&1.2
1309   */
1310  export function off(type: 'didLayout', context: UIContext, callback?: Callback<void>): void;
1311
1312  /**
1313   * Registers a callback function to be called when the tabContent is showed or hidden.
1314   *
1315   * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'.
1316   * @param { ObserverOptions } options - The options object.
1317   * @param { Callback<TabContentInfo> } callback - The callback function to be called when when the tabContent is showed or hidden.
1318   * @syscap SystemCapability.ArkUI.ArkUI.Full
1319   * @crossplatform
1320   * @atomicservice
1321   * @since arkts {'1.1':'12','1.2':'20'}
1322   * @arkts 1.1&1.2
1323   */
1324  export function on(type: 'tabContentUpdate', options: ObserverOptions, callback: Callback<TabContentInfo>): void;
1325
1326  /**
1327   * Removes a callback function that was previously registered with `on()`.
1328   *
1329   * @param { 'tabContentUpdate' } type - The type of event to remove the listener for. Must be 'tabContentUpdate'.
1330   * @param { ObserverOptions } options - The options object.
1331   * @param { Callback<TabContentInfo> } callback - The callback function to remove. If not provided, all callbacks for the given event type and
1332   *                                                    Tabs ID will be removed.
1333   * @syscap SystemCapability.ArkUI.ArkUI.Full
1334   * @crossplatform
1335   * @atomicservice
1336   * @since arkts {'1.1':'12','1.2':'20'}
1337   * @arkts 1.1&1.2
1338   */
1339  export function off(type: 'tabContentUpdate', options: ObserverOptions, callback?: Callback<TabContentInfo>): void;
1340
1341  /**
1342   * Registers a callback function to be called when the tabContent is showed or hidden.
1343   *
1344   * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'.
1345   * @param { Callback<TabContentInfo> } callback - The callback function to be called when the tabContent is showed or hidden.
1346   * @syscap SystemCapability.ArkUI.ArkUI.Full
1347   * @crossplatform
1348   * @atomicservice
1349   * @since arkts {'1.1':'12','1.2':'20'}
1350   * @arkts 1.1&1.2
1351   */
1352  export function on(type: 'tabContentUpdate', callback: Callback<TabContentInfo>): void;
1353
1354  /**
1355   * Removes a callback function that was previously registered with `on()`.
1356   *
1357   * @param { 'tabContentUpdate'} type - The type of event to remove the listener for. Must be 'tabContentUpdate'.
1358   * @param { Callback<TabContentInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1359   *                                                      will be removed.
1360   * @syscap SystemCapability.ArkUI.ArkUI.Full
1361   * @crossplatform
1362   * @atomicservice
1363   * @since arkts {'1.1':'12','1.2':'20'}
1364   * @arkts 1.1&1.2
1365   */
1366  export function off(type: 'tabContentUpdate', callback?: Callback<TabContentInfo>): void;
1367
1368  /**
1369   * Registers a callback function to be called when the navigation switched to a new navDestination.
1370   *
1371   * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'.
1372   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1373   * @param { Callback<NavDestinationSwitchInfo> } callback - The callback function to be called when the navigation switched to a new navDestination.
1374   * @syscap SystemCapability.ArkUI.ArkUI.Full
1375   * @crossplatform
1376   * @atomicservice
1377   * @since arkts {'1.1':'12','1.2':'20'}
1378   * @arkts 1.1&1.2
1379   */
1380  export function on(
1381    type: 'navDestinationSwitch',
1382    context: UIAbilityContext | UIContext,
1383    callback: Callback<NavDestinationSwitchInfo>
1384  ): void;
1385
1386  /**
1387   * Removes a callback function that was previously registered with `on()`.
1388   *
1389   * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'.
1390   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1391   * @param { Callback<NavDestinationSwitchInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1392   *                                                               will be removed.
1393   * @syscap SystemCapability.ArkUI.ArkUI.Full
1394   * @crossplatform
1395   * @atomicservice
1396   * @since arkts {'1.1':'12','1.2':'20'}
1397   * @arkts 1.1&1.2
1398   */
1399  export function off(
1400    type: 'navDestinationSwitch',
1401    context: UIAbilityContext | UIContext,
1402    callback?: Callback<NavDestinationSwitchInfo>
1403  ): void;
1404
1405  /**
1406   * Registers a callback function to be called when the navigation switched to a new navDestination.
1407   *
1408   * @param { 'navDestinationSwitch' } type - The type of event to listen for. Must be 'navDestinationSwitch'.
1409   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1410   * @param { NavDestinationSwitchObserverOptions } observerOptions - Options.
1411   * @param { Callback<NavDestinationSwitchInfo> } callback - The callback function to be called when the navigation switched to a new navDestination.
1412   * @syscap SystemCapability.ArkUI.ArkUI.Full
1413   * @crossplatform
1414   * @atomicservice
1415   * @since arkts {'1.1':'12','1.2':'20'}
1416   * @arkts 1.1&1.2
1417   */
1418  export function on(
1419    type: 'navDestinationSwitch',
1420    context: UIAbilityContext | UIContext,
1421    observerOptions: NavDestinationSwitchObserverOptions,
1422    callback: Callback<NavDestinationSwitchInfo>
1423  ): void;
1424
1425  /**
1426   * Removes a callback function that was previously registered with `on()`.
1427   *
1428   * @param { 'navDestinationSwitch' } type - The type of event to remove the listener for. Must be 'navDestinationSwitch'.
1429   * @param { UIAbilityContext | UIContext } context - The context scope of the observer.
1430   * @param { NavDestinationSwitchObserverOptions } observerOptions - Options.
1431   * @param { Callback<NavDestinationSwitchInfo> } [callback] - The callback function to remove. If not provided, all callbacks for the given event type
1432   *                                                               will be removed.
1433   * @syscap SystemCapability.ArkUI.ArkUI.Full
1434   * @crossplatform
1435   * @atomicservice
1436   * @since arkts {'1.1':'12','1.2':'20'}
1437   * @arkts 1.1&1.2
1438   */
1439  export function off(
1440    type: 'navDestinationSwitch',
1441    context: UIAbilityContext | UIContext,
1442    observerOptions: NavDestinationSwitchObserverOptions,
1443    callback?: Callback<NavDestinationSwitchInfo>
1444  ): void;
1445}
1446
1447export default uiObserver;
1448