@microsoft/fast-router 0.4.2 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +0 -4
- package/CHANGELOG.json +105 -1
- package/CHANGELOG.md +19 -2
- package/README.md +3 -32
- package/dist/dts/commands.d.ts +5 -5
- package/dist/dts/configuration.d.ts +1 -1
- package/dist/dts/contributors.d.ts +24 -6
- package/dist/dts/events.d.ts +2 -2
- package/dist/dts/fast-router.d.ts +1 -1
- package/dist/dts/links.d.ts +2 -2
- package/dist/dts/navigation.d.ts +7 -7
- package/dist/dts/phases.d.ts +6 -6
- package/dist/dts/process.d.ts +2 -2
- package/dist/dts/query-string.d.ts +2 -2
- package/dist/dts/recognizer.d.ts +6 -6
- package/dist/dts/router.d.ts +6 -6
- package/dist/dts/routes.d.ts +26 -26
- package/dist/dts/titles.d.ts +2 -2
- package/dist/dts/view.d.ts +8 -8
- package/dist/esm/commands.js +10 -8
- package/dist/esm/configuration.js +1 -1
- package/dist/esm/contributors.js +9 -9
- package/dist/esm/events.js +1 -1
- package/dist/esm/fast-router.js +1 -1
- package/dist/esm/links.js +1 -1
- package/dist/esm/navigation.js +4 -4
- package/dist/esm/process.js +1 -1
- package/dist/esm/query-string.js +1 -1
- package/dist/esm/recognizer.js +16 -16
- package/dist/esm/router.js +4 -19
- package/dist/esm/routes.js +1 -1
- package/dist/esm/titles.js +1 -1
- package/dist/esm/view.js +8 -8
- package/dist/fast-router.api.json +9699 -2
- package/dist/fast-router.d.ts +101 -83
- package/dist/fast-router.untrimmed.d.ts +825 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/api-report.md +90 -86
- package/karma.conf.cjs +6 -17
- package/package.json +11 -15
- package/dist/dts/index-rollup.d.ts +0 -2
- package/dist/esm/index-rollup.js +0 -2
- package/dist/fast-router.js +0 -6776
- package/dist/fast-router.min.js +0 -1
package/.eslintrc.json
CHANGED
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,111 @@
|
|
|
2
2
|
"name": "@microsoft/fast-router",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 01 Jun 2022 17:53:14 GMT",
|
|
6
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.1",
|
|
7
|
+
"version": "1.0.0-alpha.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "fix: update router to work with new template primitives",
|
|
12
|
+
"author": "roeisenb@microsoft.com",
|
|
13
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
14
|
+
"package": "@microsoft/fast-router"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"comment": "fix: update router to new directive APIs.",
|
|
18
|
+
"author": "roeisenb@microsoft.com",
|
|
19
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
20
|
+
"package": "@microsoft/fast-router"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"comment": "chore: remove rollup of router",
|
|
24
|
+
"author": "roeisenb@microsoft.com",
|
|
25
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
26
|
+
"package": "@microsoft/fast-router"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"comment": "Upgrade TypeScript",
|
|
30
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
31
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
32
|
+
"package": "@microsoft/fast-router"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"comment": "Set prerelease version",
|
|
36
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
37
|
+
"commit": "5b313a3262b977acbee3c2efac87d0d14a82f792",
|
|
38
|
+
"package": "@microsoft/fast-router"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"comment": "chore: configure fast-router for internals stripping",
|
|
42
|
+
"author": "roeisenb@microsoft.com",
|
|
43
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
44
|
+
"package": "@microsoft/fast-router"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"comment": "refactor: new design for execution context",
|
|
48
|
+
"author": "roeisenb@microsoft.com",
|
|
49
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
50
|
+
"package": "@microsoft/fast-router"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"comment": "Update the fast-router with the updates to fast-element 2.0 APIs",
|
|
54
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
55
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
56
|
+
"package": "@microsoft/fast-router"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"comment": "fix: update to latest fast-element utilities",
|
|
60
|
+
"author": "roeisenb@microsoft.com",
|
|
61
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
62
|
+
"package": "@microsoft/fast-router"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"comment": "Fixed an updated export from FAST element 2.0",
|
|
66
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
67
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
68
|
+
"package": "@microsoft/fast-router"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"none": [
|
|
72
|
+
{
|
|
73
|
+
"comment": "update api extractor and typescript to use the latest versions",
|
|
74
|
+
"author": "chhol@microsoft.com",
|
|
75
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
76
|
+
"package": "@microsoft/fast-router"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"comment": "docs: update a few readme files",
|
|
80
|
+
"author": "roeisenb@microsoft.com",
|
|
81
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
82
|
+
"package": "@microsoft/fast-router"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.1",
|
|
86
|
+
"author": "roeisenb@microsoft.com",
|
|
87
|
+
"commit": "4699e77715068f8610aae908ede6356a249574b6",
|
|
88
|
+
"package": "@microsoft/fast-router"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"date": "Sun, 29 May 2022 07:08:52 GMT",
|
|
95
|
+
"tag": "@microsoft/fast-router_v0.4.2",
|
|
96
|
+
"version": "0.4.2",
|
|
97
|
+
"comments": {
|
|
98
|
+
"none": [
|
|
99
|
+
{
|
|
100
|
+
"comment": "Bump @microsoft/fast-element to v1.10.2",
|
|
101
|
+
"author": "steph@huynhicode.dev",
|
|
102
|
+
"commit": "283b4838d46ed83c70ff4ad91f7f72a4936d59bf",
|
|
103
|
+
"package": "@microsoft/fast-router"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"date": "Tue, 24 May 2022 07:10:02 GMT",
|
|
6
110
|
"tag": "@microsoft/fast-router_v0.4.2",
|
|
7
111
|
"version": "0.4.2",
|
|
8
112
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# Change Log - @microsoft/fast-router
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 01 Jun 2022 17:53:14 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.0.0-alpha.1
|
|
8
|
+
|
|
9
|
+
Wed, 01 Jun 2022 17:53:14 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- fix: update router to work with new template primitives (roeisenb@microsoft.com)
|
|
14
|
+
- fix: update router to new directive APIs. (roeisenb@microsoft.com)
|
|
15
|
+
- chore: remove rollup of router (roeisenb@microsoft.com)
|
|
16
|
+
- Upgrade TypeScript (nicholasrice@users.noreply.github.com)
|
|
17
|
+
- Set prerelease version (nicholasrice@users.noreply.github.com)
|
|
18
|
+
- chore: configure fast-router for internals stripping (roeisenb@microsoft.com)
|
|
19
|
+
- refactor: new design for execution context (roeisenb@microsoft.com)
|
|
20
|
+
- Update the fast-router with the updates to fast-element 2.0 APIs (7559015+janechu@users.noreply.github.com)
|
|
21
|
+
- fix: update to latest fast-element utilities (roeisenb@microsoft.com)
|
|
22
|
+
- Fixed an updated export from FAST element 2.0 (7559015+janechu@users.noreply.github.com)
|
|
23
|
+
|
|
7
24
|
## 0.4.2
|
|
8
25
|
|
|
9
|
-
Tue, 24 May 2022 07:
|
|
26
|
+
Tue, 24 May 2022 07:10:02 GMT
|
|
10
27
|
|
|
11
28
|
### Patches
|
|
12
29
|
|
package/README.md
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
# FAST Router
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://badge.fury.io/js/%40microsoft%2Ffast-router)
|
|
5
|
-
|
|
6
|
-
The `fast-router` package contains a history-based navigation and routing solution designed around web components. By using `fast-router`, you can create multi-page and full application experiences.
|
|
3
|
+
The `@microsoft/fast-router` package contains a history-based navigation and routing solution designed around Web Components. By using `fast-router`, you can create multi-page and full application experiences. The router works with any Web Components, but has special support for Web Components built on FAST.
|
|
7
4
|
|
|
8
5
|
## Installation
|
|
9
6
|
|
|
@@ -27,36 +24,10 @@ import { FASTRouter } from '@microsoft/fast-router';
|
|
|
27
24
|
|
|
28
25
|
Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](https://fast.design/docs/integrations/introduction).
|
|
29
26
|
|
|
30
|
-
### From CDN
|
|
31
|
-
|
|
32
|
-
A pre-bundled script that contains all APIs needed to use FAST Router and FAST Element is available on CDN. You can use this script by adding [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to the script element and then importing from the CDN.
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<!DOCTYPE html>
|
|
36
|
-
<html lang="en">
|
|
37
|
-
<head>
|
|
38
|
-
<script type="module">
|
|
39
|
-
import { FASTRouter } from "https://cdn.jsdelivr.net/npm/@microsoft/fast-router/dist/fast-router.min.js";
|
|
40
|
-
|
|
41
|
-
// your code here
|
|
42
|
-
</script>
|
|
43
|
-
</head>
|
|
44
|
-
<!-- ... -->
|
|
45
|
-
</html>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The markup above always references the latest release. When deploying to production, you will want to ship with a specific version. Here's an example of the markup for that:
|
|
49
|
-
|
|
50
|
-
```html
|
|
51
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@microsoft/fast-router@0.2.11/dist/fast-router.min.js"></script>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
:::note
|
|
55
|
-
For simplicity, examples throughout the documentation will assume the library has been installed from NPM, but you can always replace the import location with the CDN URL.
|
|
56
|
-
:::
|
|
57
|
-
|
|
58
27
|
## Configuration at a Glance
|
|
59
28
|
|
|
29
|
+
The router is currently in `alpha` while we address a few bugs, finish up some final polish, and write the full documentation. Below is a quick sample of how to configure the router, to help get you going while we complete the full documentation.
|
|
30
|
+
|
|
60
31
|
#### A Sample Route Configuration
|
|
61
32
|
|
|
62
33
|
```ts
|
package/dist/dts/commands.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { RecognizedRoute } from "./recognizer.js";
|
|
|
6
6
|
import { NavigationContributor } from "./contributors.js";
|
|
7
7
|
import { NavigationCommitPhase, NavigationPhase } from "./phases.js";
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @beta
|
|
10
10
|
*/
|
|
11
11
|
export interface NavigationCommand {
|
|
12
12
|
createContributor(router: Router, route: RecognizedRoute): Promise<NavigationContributor>;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* @
|
|
15
|
+
* @beta
|
|
16
16
|
*/
|
|
17
17
|
export interface RenderCommand extends NavigationCommand {
|
|
18
18
|
layout: Layout;
|
|
@@ -20,7 +20,7 @@ export interface RenderCommand extends NavigationCommand {
|
|
|
20
20
|
createView(): Promise<RouteView>;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* @
|
|
23
|
+
* @beta
|
|
24
24
|
*/
|
|
25
25
|
export declare class Ignore implements NavigationCommand {
|
|
26
26
|
createContributor(): Promise<{
|
|
@@ -28,7 +28,7 @@ export declare class Ignore implements NavigationCommand {
|
|
|
28
28
|
}>;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* @
|
|
31
|
+
* @beta
|
|
32
32
|
*/
|
|
33
33
|
export declare class Redirect implements NavigationCommand {
|
|
34
34
|
private redirect;
|
|
@@ -47,7 +47,7 @@ declare class RenderContributor {
|
|
|
47
47
|
commit(phase: NavigationCommitPhase): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* @
|
|
50
|
+
* @beta
|
|
51
51
|
*/
|
|
52
52
|
export declare class Render implements RenderCommand {
|
|
53
53
|
private owner;
|
|
@@ -10,7 +10,7 @@ import { NavigationContributor } from "./contributors.js";
|
|
|
10
10
|
import { NavigationPhaseHook, NavigationPhaseName } from "./phases.js";
|
|
11
11
|
import { RouteRecognizer } from "./recognizer.js";
|
|
12
12
|
/**
|
|
13
|
-
* @
|
|
13
|
+
* @beta
|
|
14
14
|
*/
|
|
15
15
|
export declare abstract class RouterConfiguration<TSettings = any> {
|
|
16
16
|
private isConfigured;
|
|
@@ -1,23 +1,41 @@
|
|
|
1
|
-
import { HTMLDirective } from "@microsoft/fast-element";
|
|
1
|
+
import { AddViewBehaviorFactory, Behavior, HTMLDirective, ViewBehaviorTargets } from "@microsoft/fast-element";
|
|
2
2
|
import { NavigationCommitPhaseHook, NavigationPhaseHook, NavigationPhaseName } from "./phases.js";
|
|
3
|
+
import { RouterExecutionContext } from "./view.js";
|
|
3
4
|
/**
|
|
4
|
-
* @
|
|
5
|
+
* @beta
|
|
5
6
|
*/
|
|
6
7
|
export declare type NavigationContributor<TSettings = any> = Partial<Record<Exclude<NavigationPhaseName, "commit">, NavigationPhaseHook<TSettings>>> & {
|
|
7
8
|
commit?: NavigationCommitPhaseHook<TSettings>;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
|
-
* @
|
|
11
|
+
* @beta
|
|
11
12
|
*/
|
|
12
13
|
export declare function isNavigationPhaseContributor<T extends NavigationPhaseName>(object: any, phase: T): object is Record<T, NavigationPhaseHook>;
|
|
13
14
|
/**
|
|
14
|
-
* @
|
|
15
|
+
* @beta
|
|
15
16
|
*/
|
|
16
17
|
export declare type ContributorOptions = {
|
|
17
18
|
lifecycle?: boolean;
|
|
18
19
|
parameters?: boolean;
|
|
19
20
|
};
|
|
21
|
+
declare class NavigationContributorDirective implements HTMLDirective {
|
|
22
|
+
private options;
|
|
23
|
+
id: string;
|
|
24
|
+
nodeId: string;
|
|
25
|
+
constructor(options: Required<ContributorOptions>);
|
|
26
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
27
|
+
createBehavior(targets: ViewBehaviorTargets): NavigationContributorBehavior;
|
|
28
|
+
}
|
|
29
|
+
declare class NavigationContributorBehavior implements Behavior {
|
|
30
|
+
private contributor;
|
|
31
|
+
private options;
|
|
32
|
+
private router;
|
|
33
|
+
constructor(contributor: HTMLElement & NavigationContributor, options: Required<ContributorOptions>);
|
|
34
|
+
bind(source: unknown, context: RouterExecutionContext): void;
|
|
35
|
+
unbind(source: unknown): void;
|
|
36
|
+
}
|
|
20
37
|
/**
|
|
21
|
-
* @
|
|
38
|
+
* @beta
|
|
22
39
|
*/
|
|
23
|
-
export declare function navigationContributor(options?: ContributorOptions):
|
|
40
|
+
export declare function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;
|
|
41
|
+
export {};
|
package/dist/dts/events.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { NavigationPhase } from "./phases.js";
|
|
|
4
4
|
import { RecognizedRoute } from "./recognizer.js";
|
|
5
5
|
import { Router } from "./router.js";
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export interface RoutingEventSink {
|
|
10
10
|
onUnhandledNavigationMessage(router: Router, message: NavigationMessage): void;
|
|
@@ -14,7 +14,7 @@ export interface RoutingEventSink {
|
|
|
14
14
|
onNavigationEnd(router: Router, route: RecognizedRoute, command: NavigationCommand): void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
17
|
+
* @beta
|
|
18
18
|
*/
|
|
19
19
|
export declare class DefaultRoutingEventSink implements RoutingEventSink {
|
|
20
20
|
onUnhandledNavigationMessage(router: Router, message: NavigationMessage): void;
|
|
@@ -2,7 +2,7 @@ import { FASTElement } from "@microsoft/fast-element";
|
|
|
2
2
|
import { RouterElement } from "./router.js";
|
|
3
3
|
declare const FASTRouter_base: new () => FASTElement & RouterElement;
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @beta
|
|
6
6
|
*/
|
|
7
7
|
export declare class FASTRouter extends FASTRouter_base {
|
|
8
8
|
}
|
package/dist/dts/links.d.ts
CHANGED
package/dist/dts/navigation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from "./router.js";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @beta
|
|
4
4
|
*/
|
|
5
5
|
export interface Route {
|
|
6
6
|
readonly path: string;
|
|
@@ -8,27 +8,27 @@ export interface Route {
|
|
|
8
8
|
readonly caseSensitive?: boolean;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* @
|
|
11
|
+
* @beta
|
|
12
12
|
*/
|
|
13
13
|
export declare class NavigationMessage {
|
|
14
14
|
path: string;
|
|
15
15
|
constructor(path: string);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* @
|
|
18
|
+
* @beta
|
|
19
19
|
*/
|
|
20
20
|
export interface NavigationHandler {
|
|
21
21
|
enqueue(msg: NavigationMessage): void;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* @
|
|
24
|
+
* @beta
|
|
25
25
|
*/
|
|
26
26
|
export declare const NavigationHandler: Readonly<{
|
|
27
27
|
register(handler: NavigationHandler): void;
|
|
28
28
|
unregister(handler: NavigationHandler): void;
|
|
29
29
|
}>;
|
|
30
30
|
/**
|
|
31
|
-
* @
|
|
31
|
+
* @beta
|
|
32
32
|
*/
|
|
33
33
|
export interface NavigationQueue {
|
|
34
34
|
connect(): void;
|
|
@@ -36,7 +36,7 @@ export interface NavigationQueue {
|
|
|
36
36
|
receive(): Promise<NavigationMessage>;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* @
|
|
39
|
+
* @beta
|
|
40
40
|
*/
|
|
41
41
|
export declare const Route: Readonly<{
|
|
42
42
|
path: Readonly<{
|
|
@@ -54,7 +54,7 @@ export declare const Route: Readonly<{
|
|
|
54
54
|
}>;
|
|
55
55
|
}>;
|
|
56
56
|
/**
|
|
57
|
-
* @
|
|
57
|
+
* @beta
|
|
58
58
|
*/
|
|
59
59
|
export declare class DefaultNavigationQueue implements NavigationQueue, NavigationHandler {
|
|
60
60
|
private queue;
|
package/dist/dts/phases.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { RecognizedRoute } from "./recognizer.js";
|
|
2
2
|
import { Router } from "./router.js";
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @beta
|
|
5
5
|
*/
|
|
6
6
|
export declare type NavigationPhaseName = "navigate" | "leave" | "construct" | "enter" | "commit";
|
|
7
7
|
/**
|
|
8
|
-
* @
|
|
8
|
+
* @beta
|
|
9
9
|
*/
|
|
10
10
|
export declare type NavigationPhaseHook<TSettings = any> = (phase: NavigationPhase<TSettings>) => Promise<any> | any;
|
|
11
11
|
/**
|
|
12
|
-
* @
|
|
12
|
+
* @beta
|
|
13
13
|
*/
|
|
14
14
|
export declare type NavigationCommitPhaseHook<TSettings = any> = (phase: NavigationCommitPhase<TSettings>) => Promise<any> | any;
|
|
15
15
|
/**
|
|
16
|
-
* @
|
|
16
|
+
* @beta
|
|
17
17
|
*/
|
|
18
18
|
export declare type NavigationPhaseFollowupAction = () => Promise<any> | any;
|
|
19
19
|
/**
|
|
20
|
-
* @
|
|
20
|
+
* @beta
|
|
21
21
|
*/
|
|
22
22
|
export interface NavigationPhase<TSettings = any> {
|
|
23
23
|
readonly name: NavigationPhaseName;
|
|
@@ -30,7 +30,7 @@ export interface NavigationPhase<TSettings = any> {
|
|
|
30
30
|
evaluateContributor(contributor: any, route?: RecognizedRoute<TSettings>, router?: Router<TSettings>): Promise<void>;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* @
|
|
33
|
+
* @beta
|
|
34
34
|
*/
|
|
35
35
|
export interface NavigationCommitPhase<TSettings = any> extends Omit<NavigationPhase<TSettings>, "cancel" | "canceled" | "onCancel"> {
|
|
36
36
|
setTitle(title: string): any;
|
package/dist/dts/process.d.ts
CHANGED
|
@@ -20,13 +20,13 @@ declare class NavigationPhaseImpl<TSettings = any> implements NavigationCommitPh
|
|
|
20
20
|
evaluateContributor(contributor: any, route?: RecognizedRoute<TSettings>, router?: Router): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* @
|
|
23
|
+
* @beta
|
|
24
24
|
*/
|
|
25
25
|
export interface NavigationProcess {
|
|
26
26
|
run(router: Router, message: NavigationMessage): Promise<void>;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* @
|
|
29
|
+
* @beta
|
|
30
30
|
*/
|
|
31
31
|
export declare class DefaultNavigationProcess<TSettings> {
|
|
32
32
|
private phases;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @beta
|
|
3
3
|
*/
|
|
4
4
|
export declare const QueryString: Readonly<{
|
|
5
5
|
readonly current: string;
|
|
@@ -10,7 +10,7 @@ export declare const QueryString: Readonly<{
|
|
|
10
10
|
* @param traditional - Boolean Use the old URI template standard (RFC6570)
|
|
11
11
|
* @returns The generated query string, excluding leading '?'.
|
|
12
12
|
*/
|
|
13
|
-
build(params: Object, traditional?: boolean
|
|
13
|
+
build(params: Object, traditional?: boolean): string;
|
|
14
14
|
/**
|
|
15
15
|
* Separate the query string from the path and returns the two parts.
|
|
16
16
|
* @param path - The path to separate.
|
package/dist/dts/recognizer.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Route } from "./navigation.js";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @beta
|
|
4
4
|
*/
|
|
5
5
|
export declare type RouteParameterConverter = (value: string | undefined) => any | Promise<any>;
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export declare class ConfigurableRoute implements Route {
|
|
10
10
|
readonly path: string;
|
|
@@ -13,7 +13,7 @@ export declare class ConfigurableRoute implements Route {
|
|
|
13
13
|
constructor(path: string, name: string, caseSensitive: boolean);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* @
|
|
16
|
+
* @beta
|
|
17
17
|
*/
|
|
18
18
|
export declare class Endpoint<TSettings = any> {
|
|
19
19
|
readonly route: ConfigurableRoute;
|
|
@@ -24,7 +24,7 @@ export declare class Endpoint<TSettings = any> {
|
|
|
24
24
|
get path(): string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* @
|
|
27
|
+
* @beta
|
|
28
28
|
*/
|
|
29
29
|
export declare class RecognizedRoute<TSettings = any> {
|
|
30
30
|
readonly endpoint: Endpoint<TSettings>;
|
|
@@ -37,7 +37,7 @@ export declare class RecognizedRoute<TSettings = any> {
|
|
|
37
37
|
get settings(): TSettings | null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* @
|
|
40
|
+
* @beta
|
|
41
41
|
*/
|
|
42
42
|
export interface RouteRecognizer<TSettings> {
|
|
43
43
|
add(routeOrRoutes: Route | readonly Route[], settings?: TSettings): void;
|
|
@@ -46,7 +46,7 @@ export interface RouteRecognizer<TSettings> {
|
|
|
46
46
|
generateFromPath(path: string, params: object): string | null;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* @
|
|
49
|
+
* @beta
|
|
50
50
|
*/
|
|
51
51
|
export declare class DefaultRouteRecognizer<TSettings> implements RouteRecognizer<TSettings> {
|
|
52
52
|
private names;
|
package/dist/dts/router.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { RouterConfiguration } from "./configuration.js";
|
|
|
4
4
|
import { NavigationContributor } from "./contributors.js";
|
|
5
5
|
import { RecognizedRoute } from "./recognizer.js";
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export interface RenderOperation {
|
|
10
10
|
commit(): Promise<void>;
|
|
11
11
|
rollback(): Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* @
|
|
14
|
+
* @beta
|
|
15
15
|
*/
|
|
16
16
|
export interface Router<TSettings = any> {
|
|
17
17
|
readonly level: number;
|
|
@@ -27,7 +27,7 @@ export interface Router<TSettings = any> {
|
|
|
27
27
|
}
|
|
28
28
|
declare const routerProperty = "$router";
|
|
29
29
|
/**
|
|
30
|
-
* @
|
|
30
|
+
* @beta
|
|
31
31
|
*/
|
|
32
32
|
export interface RouterElement extends HTMLElement {
|
|
33
33
|
readonly [routerProperty]: Router;
|
|
@@ -36,7 +36,7 @@ export interface RouterElement extends HTMLElement {
|
|
|
36
36
|
disconnectedCallback(): any;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* @
|
|
39
|
+
* @beta
|
|
40
40
|
*/
|
|
41
41
|
export declare const Router: Readonly<{
|
|
42
42
|
getOrCreateFor(element: HTMLElement): Router<any> | DefaultRouter;
|
|
@@ -47,11 +47,11 @@ export declare const Router: Readonly<{
|
|
|
47
47
|
}>(BaseType: TBase): new () => InstanceType<TBase> & RouterElement;
|
|
48
48
|
}>;
|
|
49
49
|
/**
|
|
50
|
-
* @
|
|
50
|
+
* @beta
|
|
51
51
|
*/
|
|
52
52
|
export declare function isFASTElementHost(host: HTMLElement): host is HTMLElement & FASTElement;
|
|
53
53
|
/**
|
|
54
|
-
* @
|
|
54
|
+
* @beta
|
|
55
55
|
*/
|
|
56
56
|
export declare class DefaultRouter implements Router {
|
|
57
57
|
readonly host: HTMLElement;
|