@esportsplus/routing 0.0.33 → 0.0.34
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/build/browser.d.ts +7 -2
- package/build/browser.js +1 -0
- package/package.json +1 -1
- package/src/browser.ts +4 -2
package/build/browser.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Scheduler } from '@esportsplus/reactivity';
|
|
2
|
+
import { Middleware, Next, NeverAsync, Request, Route, Router } from './types';
|
|
2
3
|
declare function back(): void;
|
|
3
4
|
declare function forward(): void;
|
|
4
5
|
declare const _default: <T>(instance?: Router<T> | undefined) => {
|
|
5
6
|
back: typeof back;
|
|
6
7
|
forward: typeof forward;
|
|
7
|
-
middleware:
|
|
8
|
+
middleware: {
|
|
9
|
+
(...middleware: Middleware<T>[]): () => NeverAsync<T>;
|
|
10
|
+
dispatch(request: Request<T>): NeverAsync<T>;
|
|
11
|
+
match(fallback: Route<T>, scheduler: Scheduler, subdomain?: string | undefined): (request: Request<T>, next: Next<T>) => import("@esportsplus/template/build/types").Template;
|
|
12
|
+
};
|
|
8
13
|
redirect: (path: string, values?: unknown[]) => void;
|
|
9
14
|
router: Router<T>;
|
|
10
15
|
uri: (path: string, values?: unknown[]) => string;
|
package/build/browser.js
CHANGED
package/package.json
CHANGED
package/src/browser.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { effect, reactive, root, Scheduler } from '@esportsplus/reactivity';
|
|
2
2
|
import { html } from '@esportsplus/template';
|
|
3
|
-
import { Middleware, Next, Request, Route, Router } from './types';
|
|
3
|
+
import { Middleware, Next, NeverAsync, Request, Route, Router } from './types';
|
|
4
4
|
import pipeline from '@esportsplus/pipeline';
|
|
5
5
|
import factory from './router';
|
|
6
6
|
|
|
@@ -55,7 +55,7 @@ function middleware<T>(request: Request<T>, router: Router<T>) {
|
|
|
55
55
|
return () => instance(request);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
host.dispatch = (request: Request<T>) => {
|
|
58
|
+
host.dispatch = (request: Request<T>): NeverAsync<T> => {
|
|
59
59
|
let { route } = request.data;
|
|
60
60
|
|
|
61
61
|
if (route === undefined) {
|
|
@@ -97,6 +97,8 @@ function middleware<T>(request: Request<T>, router: Router<T>) {
|
|
|
97
97
|
}}`;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
+
|
|
101
|
+
return host;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
function normalize(uri: string) {
|