1 | import { App } from 'vue';
|
2 | import { Component } from 'vue';
|
3 | import { ComponentPublicInstance } from 'vue';
|
4 | import { ComputedRef } from 'vue';
|
5 | import { Ref } from 'vue';
|
6 | import { VNodeProps } from 'vue';
|
7 |
|
8 | declare type Awaitable<T> = T | Promise<T>;
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare function createMemoryHistory(base?: string): RouterHistory;
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export declare function createRouter(options: RouterOptions): Router;
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare function createRouterMatcher(routes: RouteRecordRaw[], globalOptions: PathParserOptions): RouterMatcher;
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare function createWebHashHistory(base?: string): RouterHistory;
|
57 |
|
58 | export declare function createWebHistory(base?: string): RouterHistory;
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export declare type ErrorHandler = (error: any) => any;
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | declare const enum ErrorTypes {
|
70 | MATCHER_NOT_FOUND = 1,
|
71 | NAVIGATION_GUARD_REDIRECT = 2,
|
72 | NAVIGATION_ABORTED = 4,
|
73 | NAVIGATION_CANCELLED = 8,
|
74 | NAVIGATION_DUPLICATED = 16
|
75 | }
|
76 |
|
77 | declare type HistoryLocation = string;
|
78 |
|
79 | declare interface HistoryState {
|
80 | [x: number]: HistoryStateValue;
|
81 | [x: string]: HistoryStateValue;
|
82 | }
|
83 |
|
84 | declare interface HistoryStateArray extends Array<HistoryStateValue> {
|
85 | }
|
86 |
|
87 | declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | export declare function isNavigationFailure(error: any, type?: ErrorTypes.NAVIGATION_GUARD_REDIRECT): error is NavigationRedirectError;
|
115 |
|
116 | export declare function isNavigationFailure(error: any, type?: ErrorTypes | NavigationFailureType): error is NavigationFailure;
|
117 |
|
118 | declare type Lazy<T> = () => Promise<T>;
|
119 |
|
120 | declare interface LocationAsName {
|
121 | name: RouteRecordName;
|
122 | params?: RouteParams;
|
123 | }
|
124 |
|
125 | declare interface LocationAsNameRaw {
|
126 | name: RouteRecordName;
|
127 | params?: RouteParamsRaw;
|
128 | }
|
129 |
|
130 | declare interface LocationAsPath {
|
131 | path: string;
|
132 | }
|
133 |
|
134 | declare interface LocationAsRelative {
|
135 | params?: RouteParams;
|
136 | }
|
137 |
|
138 | declare interface LocationAsRelativeRaw {
|
139 | params?: RouteParamsRaw;
|
140 | }
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | export declare type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 | export declare type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 | export declare type LocationQueryValue = string | null;
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 | declare type LocationQueryValueRaw = LocationQueryValue | number | undefined;
|
171 |
|
172 | declare interface MatcherLocation extends Pick<RouteLocation, 'name' | 'path' | 'params' | 'matched' | 'meta'> {
|
173 | }
|
174 |
|
175 | declare type MatcherLocationRaw = LocationAsPath | LocationAsName | LocationAsRelative;
|
176 |
|
177 | declare interface NavigationCallback {
|
178 | (to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;
|
179 | }
|
180 |
|
181 | declare enum NavigationDirection {
|
182 | back = "back",
|
183 | forward = "forward",
|
184 | unknown = ""
|
185 | }
|
186 |
|
187 | export declare interface NavigationFailure extends RouterErrorBase {
|
188 | type: ErrorTypes.NAVIGATION_CANCELLED | ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED;
|
189 | from: RouteLocationNormalized;
|
190 | to: RouteLocationNormalized;
|
191 | }
|
192 |
|
193 | export declare enum NavigationFailureType {
|
194 | aborted = 4,
|
195 | cancelled = 8,
|
196 | duplicated = 16
|
197 | }
|
198 |
|
199 | export declare interface NavigationGuard {
|
200 | (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
|
201 | }
|
202 |
|
203 | export declare interface NavigationGuardNext {
|
204 | (): void;
|
205 | (error: Error): void;
|
206 | (location: RouteLocationRaw): void;
|
207 | (valid: boolean): void;
|
208 | (cb: NavigationGuardNextCallback): void;
|
209 | }
|
210 |
|
211 | declare type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => any;
|
212 |
|
213 | declare type NavigationGuardReturn = void | Error | RouteLocationRaw | boolean | NavigationGuardNextCallback;
|
214 |
|
215 | declare interface NavigationGuardWithThis<T> {
|
216 | (this: T, to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
|
217 | }
|
218 |
|
219 | declare interface NavigationInformation {
|
220 | type: NavigationType_2;
|
221 | direction: NavigationDirection;
|
222 | delta: number;
|
223 | }
|
224 |
|
225 | declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
|
226 | type: ErrorTypes.NAVIGATION_GUARD_REDIRECT;
|
227 | to: RouteLocationRaw;
|
228 | }
|
229 |
|
230 | declare enum NavigationType_2 {
|
231 | pop = "pop",
|
232 | push = "push"
|
233 | }
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 | export declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 | export declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 | export declare function parseQuery(search: string): LocationQuery;
|
261 |
|
262 | declare type PathParams = Record<string, string | string[]>;
|
263 |
|
264 | declare interface PathParser {
|
265 | |
266 |
|
267 |
|
268 | re: RegExp;
|
269 | |
270 |
|
271 |
|
272 | score: Array<number[]>;
|
273 | |
274 |
|
275 |
|
276 | keys: PathParserParamKey[];
|
277 | |
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 | parse(path: string): PathParams | null;
|
287 | |
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 | stringify(params: PathParams): string;
|
294 | }
|
295 |
|
296 | export declare type PathParserOptions = Pick<_PathParserOptions, 'end' | 'sensitive' | 'strict'>;
|
297 |
|
298 | export declare interface _PathParserOptions {
|
299 | |
300 |
|
301 |
|
302 | sensitive?: boolean;
|
303 | |
304 |
|
305 |
|
306 | strict?: boolean;
|
307 | |
308 |
|
309 |
|
310 | start?: boolean;
|
311 | |
312 |
|
313 |
|
314 | end?: boolean;
|
315 | }
|
316 |
|
317 |
|
318 |
|
319 |
|
320 | declare interface PathParserParamKey {
|
321 | name: string;
|
322 | repeatable: boolean;
|
323 | optional: boolean;
|
324 | }
|
325 |
|
326 | export declare interface PostNavigationGuard {
|
327 | (to: RouteLocationNormalized, from: RouteLocationNormalized, failure?: NavigationFailure | void): any;
|
328 | }
|
329 |
|
330 | declare type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
|
331 |
|
332 | declare type RouteComponent = Component;
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | export declare interface RouteLocation extends _RouteLocationBase {
|
338 | |
339 |
|
340 |
|
341 |
|
342 |
|
343 | matched: RouteRecord[];
|
344 | }
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 | export declare interface _RouteLocationBase {
|
352 | |
353 |
|
354 |
|
355 | path: string;
|
356 | |
357 |
|
358 |
|
359 |
|
360 | fullPath: string;
|
361 | |
362 |
|
363 |
|
364 | query: LocationQuery;
|
365 | |
366 |
|
367 |
|
368 | hash: string;
|
369 | |
370 |
|
371 |
|
372 | name: RouteRecordName | null | undefined;
|
373 | |
374 |
|
375 |
|
376 | params: RouteParams;
|
377 | |
378 |
|
379 |
|
380 |
|
381 | redirectedFrom: RouteLocation | undefined;
|
382 | |
383 |
|
384 |
|
385 | meta: Record<string | number | symbol, any>;
|
386 | }
|
387 |
|
388 | export declare interface RouteLocationMatched extends RouteRecordNormalized {
|
389 | components: Record<string, RouteComponent>;
|
390 | }
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 | export declare interface RouteLocationNormalized extends _RouteLocationBase {
|
397 | |
398 |
|
399 |
|
400 | matched: RouteRecordNormalized[];
|
401 | }
|
402 |
|
403 |
|
404 |
|
405 |
|
406 | export declare interface RouteLocationNormalizedLoaded extends _RouteLocationBase {
|
407 | |
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 | matched: RouteLocationMatched[];
|
414 | }
|
415 |
|
416 | export declare interface RouteLocationOptions {
|
417 | |
418 |
|
419 |
|
420 | replace?: boolean;
|
421 | |
422 |
|
423 |
|
424 | force?: boolean;
|
425 | |
426 |
|
427 |
|
428 | state?: HistoryState;
|
429 | }
|
430 |
|
431 |
|
432 |
|
433 |
|
434 | export declare type RouteLocationRaw = string | (RouteQueryAndHash & LocationAsPath & RouteLocationOptions) | (RouteQueryAndHash & LocationAsNameRaw & RouteLocationOptions) | (RouteQueryAndHash & LocationAsRelativeRaw & RouteLocationOptions);
|
435 |
|
436 | export declare type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>;
|
437 |
|
438 | declare type RouteParamsRaw = Record<string, RouteParamValueRaw | RouteParamValueRaw[]>;
|
439 |
|
440 | declare type RouteParamValue = string;
|
441 |
|
442 | declare type RouteParamValueRaw = RouteParamValue | number;
|
443 |
|
444 | declare interface RouteQueryAndHash {
|
445 | query?: LocationQueryRaw;
|
446 | hash?: string;
|
447 | }
|
448 |
|
449 | export declare interface Router {
|
450 | |
451 |
|
452 |
|
453 | readonly currentRoute: Ref<RouteLocationNormalizedLoaded>;
|
454 | readonly options: RouterOptions;
|
455 | addRoute(parentName: RouteRecordName, route: RouteRecordRaw): () => void;
|
456 | addRoute(route: RouteRecordRaw): () => void;
|
457 | removeRoute(name: RouteRecordName): void;
|
458 | hasRoute(name: RouteRecordName): boolean;
|
459 | getRoutes(): RouteRecord[];
|
460 | resolve(to: RouteLocationRaw): RouteLocation & {
|
461 | href: string;
|
462 | };
|
463 | push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
464 | replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
465 | back(): Promise<NavigationFailure | void | undefined>;
|
466 | forward(): Promise<NavigationFailure | void | undefined>;
|
467 | go(delta: number): Promise<NavigationFailure | void | undefined>;
|
468 | beforeEach(guard: NavigationGuardWithThis<undefined>): () => void;
|
469 | beforeResolve(guard: NavigationGuardWithThis<undefined>): () => void;
|
470 | afterEach(guard: PostNavigationGuard): () => void;
|
471 | onError(handler: ErrorHandler): () => void;
|
472 | isReady(): Promise<void>;
|
473 | install(app: App): void;
|
474 | }
|
475 |
|
476 | export declare type RouteRecord = RouteRecordNormalized;
|
477 |
|
478 |
|
479 |
|
480 |
|
481 | export declare interface _RouteRecordBase extends PathParserOptions {
|
482 | |
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 | path: string;
|
489 | |
490 |
|
491 |
|
492 |
|
493 |
|
494 | redirect?: RouteRecordRedirectOption;
|
495 | |
496 |
|
497 |
|
498 | children?: RouteRecordRaw[];
|
499 | |
500 |
|
501 |
|
502 |
|
503 |
|
504 | alias?: string | string[];
|
505 | |
506 |
|
507 |
|
508 | name?: RouteRecordName;
|
509 | |
510 |
|
511 |
|
512 |
|
513 | beforeEnter?: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[];
|
514 | |
515 |
|
516 |
|
517 | meta?: Record<string | number | symbol, any>;
|
518 | }
|
519 |
|
520 | declare interface RouteRecordMatcher extends PathParser {
|
521 | record: RouteRecord;
|
522 | parent: RouteRecordMatcher | undefined;
|
523 | children: RouteRecordMatcher[];
|
524 | alias: RouteRecordMatcher[];
|
525 | }
|
526 |
|
527 | declare interface RouteRecordMultipleViews extends _RouteRecordBase {
|
528 | |
529 |
|
530 |
|
531 | components: Record<string, RawRouteComponent>;
|
532 | |
533 |
|
534 |
|
535 |
|
536 |
|
537 | props?: Record<string, _RouteRecordProps> | boolean;
|
538 | }
|
539 |
|
540 | declare type RouteRecordName = string | symbol;
|
541 |
|
542 | export declare interface RouteRecordNormalized {
|
543 | |
544 |
|
545 |
|
546 | path: _RouteRecordBase['path'];
|
547 | |
548 |
|
549 |
|
550 | redirect: _RouteRecordBase['redirect'] | undefined;
|
551 | |
552 |
|
553 |
|
554 | name: _RouteRecordBase['name'];
|
555 | |
556 |
|
557 |
|
558 | components: RouteRecordMultipleViews['components'];
|
559 | |
560 |
|
561 |
|
562 | children: Exclude<_RouteRecordBase['children'], void>;
|
563 | |
564 |
|
565 |
|
566 | meta: Exclude<_RouteRecordBase['meta'], void>;
|
567 | |
568 |
|
569 |
|
570 | props: Record<string, _RouteRecordProps>;
|
571 | |
572 |
|
573 |
|
574 | beforeEnter: RouteRecordMultipleViews['beforeEnter'];
|
575 | |
576 |
|
577 |
|
578 |
|
579 |
|
580 | leaveGuards: NavigationGuard[];
|
581 | |
582 |
|
583 |
|
584 |
|
585 |
|
586 | updateGuards: NavigationGuard[];
|
587 | |
588 |
|
589 |
|
590 |
|
591 |
|
592 | enterCallbacks: Record<string, NavigationGuardNextCallback[]>;
|
593 | |
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 | instances: Record<string, ComponentPublicInstance | undefined | null>;
|
603 | |
604 |
|
605 |
|
606 |
|
607 | aliasOf: RouteRecordNormalized | undefined;
|
608 | }
|
609 |
|
610 |
|
611 |
|
612 |
|
613 | declare type _RouteRecordProps = boolean | Record<string, any> | ((to: RouteLocationNormalized) => Record<string, any>);
|
614 |
|
615 | export declare type RouteRecordRaw = RouteRecordSingleView | RouteRecordMultipleViews | RouteRecordRedirect;
|
616 |
|
617 | declare interface RouteRecordRedirect extends _RouteRecordBase {
|
618 | redirect: RouteRecordRedirectOption;
|
619 | component?: never;
|
620 | components?: never;
|
621 | children?: never;
|
622 | }
|
623 |
|
624 | declare type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation) => RouteLocationRaw);
|
625 |
|
626 | declare interface RouteRecordSingleView extends _RouteRecordBase {
|
627 | /**
|
628 | * Component to display when the URL matches this route.
|
629 | */
|
630 | component: RawRouteComponent;
|
631 | /**
|
632 | * Allow passing down params as props to the component rendered by `router-view`.
|
633 | */
|
634 | props?: _RouteRecordProps;
|
635 | }
|
636 |
|
637 | declare interface RouterErrorBase extends Error {
|
638 | type: ErrorTypes;
|
639 | }
|
640 |
|
641 | /**
|
642 | * Interface implemented by History implementations that can be passed to the
|
643 | * router as {@link Router.history}
|
644 | *
|
645 | * @alpha
|
646 | */
|
647 | export declare interface RouterHistory {
|
648 | /**
|
649 | * Base path that is prepended to every url. This allows hosting an SPA at a
|
650 | * subfolder of a domain like `example.com/subfolder` by having a `base` of
|
651 | * `/subfolder`
|
652 | */
|
653 | readonly base: string;
|
654 | /**
|
655 | * Current History location
|
656 | */
|
657 | readonly location: HistoryLocation;
|
658 | /**
|
659 | * Current History state
|
660 | */
|
661 | readonly state: HistoryState;
|
662 | /**
|
663 | * Navigates to a location. In the case of an HTML5 History implementation,
|
664 | * this will call `history.pushState` to effectively change the URL.
|
665 | *
|
666 | * @param to - location to push
|
667 | * @param data - optional {@link HistoryState} to be associated with the
|
668 | * navigation entry
|
669 | */
|
670 | push(to: HistoryLocation, data?: HistoryState): void;
|
671 | /**
|
672 | * Same as {@link RouterHistory.push} but performs a `history.replaceState`
|
673 | * instead of `history.pushState`
|
674 | *
|
675 | * @param to - location to set
|
676 | * @param data - optional {@link HistoryState} to be associated with the
|
677 | * navigation entry
|
678 | */
|
679 | replace(to: HistoryLocation, data?: HistoryState): void;
|
680 | /**
|
681 | * Traverses history in a given direction.
|
682 | *
|
683 | * @example
|
684 | * ```js
|
685 | * myHistory.go(-1) // equivalent to window.history.back()
|
686 | * myHistory.go(1) // equivalent to window.history.forward()
|
687 | * ```
|
688 | *
|
689 | * @param delta - distance to travel. If delta is \< 0, it will go back,
|
690 | * if it's \> 0, it will go forward by that amount of entries.
|
691 | * @param triggerListeners - whether this should trigger listeners attached to
|
692 | * the history
|
693 | */
|
694 | go(delta: number, triggerListeners?: boolean): void;
|
695 | /**
|
696 | * Attach a listener to the History implementation that is triggered when the
|
697 | * navigation is triggered from outside (like the Browser back and forward
|
698 | * buttons) or when passing `true` to {@link RouterHistory.back} and
|
699 | * {@link RouterHistory.forward}
|
700 | *
|
701 | * @param callback - listener to attach
|
702 | * @returns a callback to remove the listener
|
703 | */
|
704 | listen(callback: NavigationCallback): () => void;
|
705 | |
706 |
|
707 |
|
708 |
|
709 |
|
710 | createHref(location: HistoryLocation): string;
|
711 | |
712 |
|
713 |
|
714 | destroy(): void;
|
715 | }
|
716 |
|
717 | export declare const RouterLink: new () => {
|
718 | $props: VNodeProps & RouterLinkProps;
|
719 | };
|
720 |
|
721 | declare interface RouterLinkOptions {
|
722 | |
723 |
|
724 |
|
725 | to: RouteLocationRaw;
|
726 | |
727 |
|
728 |
|
729 | replace?: boolean;
|
730 | }
|
731 |
|
732 | export declare interface RouterLinkProps extends RouterLinkOptions {
|
733 | |
734 |
|
735 |
|
736 | custom?: boolean;
|
737 | |
738 |
|
739 |
|
740 | activeClass?: string;
|
741 | |
742 |
|
743 |
|
744 | exactActiveClass?: string;
|
745 | |
746 |
|
747 |
|
748 | ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
|
749 | }
|
750 |
|
751 | declare interface RouterMatcher {
|
752 | addRoute: (record: RouteRecordRaw, parent?: RouteRecordMatcher) => () => void;
|
753 | removeRoute: {
|
754 | (matcher: RouteRecordMatcher): void;
|
755 | (name: RouteRecordName): void;
|
756 | };
|
757 | getRoutes: () => RouteRecordMatcher[];
|
758 | getRecordMatcher: (name: RouteRecordName) => RouteRecordMatcher | undefined;
|
759 | |
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 | resolve: (location: MatcherLocationRaw, currentLocation: MatcherLocation) => MatcherLocation;
|
766 | }
|
767 |
|
768 | export declare interface RouterOptions extends PathParserOptions {
|
769 | |
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 | history: RouterHistory;
|
785 | |
786 |
|
787 |
|
788 | routes: RouteRecordRaw[];
|
789 | |
790 |
|
791 |
|
792 | scrollBehavior?: ScrollBehavior_2;
|
793 | |
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 | parseQuery?: typeof parseQuery;
|
811 | |
812 |
|
813 |
|
814 | stringifyQuery?: typeof stringifyQuery;
|
815 | |
816 |
|
817 |
|
818 |
|
819 | linkActiveClass?: string;
|
820 | |
821 |
|
822 |
|
823 |
|
824 | linkExactActiveClass?: string;
|
825 | }
|
826 |
|
827 | export declare const RouterView: new () => {
|
828 | $props: VNodeProps & RouterViewProps;
|
829 | };
|
830 |
|
831 | export declare interface RouterViewProps {
|
832 | name?: string;
|
833 | route?: RouteLocationNormalized;
|
834 | }
|
835 |
|
836 | declare interface ScrollBehavior_2 {
|
837 | (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, savedPosition: _ScrollPositionNormalized | null): Awaitable<ScrollPosition | false | void>;
|
838 | }
|
839 | export { ScrollBehavior_2 as ScrollBehavior }
|
840 |
|
841 | declare type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 | declare type ScrollPositionCoordinates = {
|
849 | behavior?: ScrollOptions['behavior'];
|
850 | left?: number;
|
851 | top?: number;
|
852 | };
|
853 |
|
854 | declare interface ScrollPositionElement extends ScrollToOptions {
|
855 | |
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 | el: string | Element;
|
868 | }
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 | declare type _ScrollPositionNormalized = {
|
877 | behavior?: ScrollOptions['behavior'];
|
878 | left: number;
|
879 | top: number;
|
880 | };
|
881 |
|
882 | export declare const START_LOCATION: RouteLocationNormalizedLoaded;
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 | export declare function stringifyQuery(query: LocationQueryRaw): string;
|
892 |
|
893 | export declare function useLink(props: UseLinkOptions): {
|
894 | route: import("vue").ComputedRef<RouteLocation & {
|
895 | href: string;
|
896 | }>;
|
897 | href: import("vue").ComputedRef<string>;
|
898 | isActive: import("vue").ComputedRef<boolean>;
|
899 | isExactActive: import("vue").ComputedRef<boolean>;
|
900 | navigate: (e?: MouseEvent) => Promise<any>;
|
901 | };
|
902 |
|
903 | declare type UseLinkOptions = VueUseOptions<RouterLinkOptions>;
|
904 |
|
905 | export declare function useRoute(): RouteLocationNormalizedLoaded;
|
906 |
|
907 | export declare function useRouter(): Router;
|
908 |
|
909 | declare type VueUseOptions<T> = {
|
910 | [k in keyof T]: Ref<T[k]> | T[k] | ComputedRef<T[k]>;
|
911 | };
|
912 |
|
913 | export { }
|