-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathinterface.ts
More file actions
65 lines (55 loc) · 1.62 KB
/
interface.ts
File metadata and controls
65 lines (55 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import type { AnimationBuilder, ComponentProps, HTMLStencilElement } from '../../../interface';
import type { NavigationHookCallback } from '../../route/route-interface';
export interface NavOutlet {
setRouteId(
id: string,
params: ComponentProps | undefined,
direction: RouterDirection,
animation?: AnimationBuilder
): Promise<RouteWrite>;
getRouteId(): Promise<RouteID | undefined>;
}
export interface RouterEventDetail {
from: string | null;
redirectedFrom: string | null;
to: string;
}
export interface RouterCustomEvent extends CustomEvent {
detail: RouterEventDetail;
target: HTMLIonRouterElement;
}
export interface RouteRedirect {
from: string[];
to?: ParsedRoute;
}
export interface RouteWrite {
changed: boolean;
element: HTMLElement | undefined;
markVisible?: () => void | Promise<void>;
}
export interface RouteID {
id: string;
element: HTMLElement | undefined;
params?: { [key: string]: any };
}
export interface RouteEntry {
/** Component tag name or tab name. */
id: string;
segments: string[];
params: { [key: string]: any } | undefined;
beforeLeave?: NavigationHookCallback;
beforeEnter?: NavigationHookCallback;
}
export interface RouteNode extends RouteEntry {
children: RouteTree;
}
export interface ParsedRoute {
/** Parts of the route (non empty "/" separated parts of an URL). */
segments: string[];
/** Unparsed query string. */
queryString?: string;
}
export type RouterDirection = 'forward' | 'back' | 'root';
export type NavOutletElement = NavOutlet & HTMLStencilElement;
export type RouteChain = RouteEntry[];
export type RouteTree = RouteNode[];