@kitbag/router 0.26.1 → 0.28.0

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.
Files changed (88) hide show
  1. package/dist/components/routerLink.d.ts +5 -4
  2. package/dist/components/routerProgress.d.ts +18 -0
  3. package/dist/components/routerProgressBar.d.ts +12 -0
  4. package/dist/components/viewTransition.browser.spec.d.ts +1 -0
  5. package/dist/components/viewTransition.d.ts +16 -0
  6. package/dist/components/viewTransition.spec-d.d.ts +1 -0
  7. package/dist/compositions/useLink.d.ts +2 -2
  8. package/dist/compositions/useLink.spec-d.d.ts +1 -0
  9. package/dist/compositions/useNavigation.browser.spec.d.ts +1 -0
  10. package/dist/compositions/useNavigation.d.ts +5 -0
  11. package/dist/compositions/useViewTransition.d.ts +5 -0
  12. package/dist/errors/contextRedirectError.d.ts +1 -2
  13. package/dist/errors/unreachableRouteError.d.ts +7 -0
  14. package/dist/kitbag-router.js +2449 -1826
  15. package/dist/kitbag-router.umd.cjs +2 -2
  16. package/dist/main.d.ts +37 -2
  17. package/dist/main.spec-d.d.ts +1 -0
  18. package/dist/services/addAlias.d.ts +19 -0
  19. package/dist/services/addAlias.spec-d.d.ts +1 -0
  20. package/dist/services/addAlias.spec.d.ts +1 -0
  21. package/dist/services/addView.d.ts +3 -3
  22. package/dist/services/createCanonicalUrl.d.ts +14 -0
  23. package/dist/services/createCanonicalUrl.spec.d.ts +1 -0
  24. package/dist/services/createDataStore.d.ts +4 -0
  25. package/dist/services/createNavigationProgress.d.ts +49 -0
  26. package/dist/services/createNavigationProgress.spec.d.ts +1 -0
  27. package/dist/services/createNavigationSignals.d.ts +17 -0
  28. package/dist/services/createNavigationSignals.spec.d.ts +1 -0
  29. package/dist/services/createResolvedRoute.d.ts +10 -1
  30. package/dist/services/createRoute.d.ts +2 -4
  31. package/dist/services/createRouteValueStore.d.ts +4 -0
  32. package/dist/services/createRouter.d.ts +2 -2
  33. package/dist/services/createRouterAssets.d.ts +30 -0
  34. package/dist/services/createRouterHistory.d.ts +10 -2
  35. package/dist/services/createRouterHooks.d.ts +7 -2
  36. package/dist/services/createUniqueIdSequence.d.ts +0 -1
  37. package/dist/services/createViewTransitions.browser.spec.d.ts +1 -0
  38. package/dist/services/createViewTransitions.d.ts +38 -0
  39. package/dist/services/getMatchesForUrl.d.ts +4 -0
  40. package/dist/services/getRoutesForRouter.d.ts +3 -2
  41. package/dist/services/history.d.ts +1 -0
  42. package/dist/services/routeRegex.d.ts +6 -1
  43. package/dist/services/routeViews.d.ts +7 -0
  44. package/dist/services/updateResolvedRoute.d.ts +7 -0
  45. package/dist/services/updateResolvedRoute.spec.d.ts +1 -0
  46. package/dist/services/withRouteMethods.d.ts +3 -3
  47. package/dist/tests/loaderPrefetch.browser.spec.d.ts +1 -0
  48. package/dist/tests/navigationBehavior.browser.spec.d.ts +1 -0
  49. package/dist/tests/navigationProgress.spec.d.ts +1 -0
  50. package/dist/tests/viewTransitions.browser.spec.d.ts +1 -0
  51. package/dist/types/addAlias.d.ts +79 -0
  52. package/dist/types/addView.d.ts +3 -4
  53. package/dist/types/callbackContext.d.ts +0 -5
  54. package/dist/types/createRouteOptions.d.ts +23 -63
  55. package/dist/types/hooks.d.ts +9 -5
  56. package/dist/types/navigation.d.ts +38 -0
  57. package/dist/types/prefetch.d.ts +6 -1
  58. package/dist/types/props.d.ts +0 -17
  59. package/dist/types/redirects.d.ts +4 -0
  60. package/dist/types/resolved.d.ts +22 -2
  61. package/dist/types/route.d.ts +4 -3
  62. package/dist/types/routeAlias.d.ts +41 -0
  63. package/dist/types/routeCallbackContext.d.ts +1 -0
  64. package/dist/types/routeViews.d.ts +5 -7
  65. package/dist/types/routeWithMethods.d.ts +3 -2
  66. package/dist/types/router.d.ts +13 -0
  67. package/dist/types/routerLink.d.ts +1 -1
  68. package/dist/types/routerNavigationInternal.d.ts +29 -0
  69. package/dist/types/routerPush.d.ts +8 -0
  70. package/dist/types/routerReplace.d.ts +3 -0
  71. package/dist/types/routerRoute.d.ts +5 -1
  72. package/dist/types/useLink.d.ts +5 -0
  73. package/dist/types/viewTransition.d.ts +49 -0
  74. package/dist/utilities/components.d.ts +6 -2
  75. package/dist/utilities/getRegexMatcher.d.ts +1 -0
  76. package/dist/utilities/getRegexMatcher.spec.d.ts +1 -0
  77. package/dist/utilities/navigation.d.ts +15 -0
  78. package/dist/utilities/percentEncoding.d.ts +10 -0
  79. package/dist/utilities/percentEncoding.spec.d.ts +1 -0
  80. package/dist/utilities/promises.d.ts +4 -0
  81. package/dist/utilities/promises.spec.d.ts +1 -0
  82. package/dist/utilities/testHelpers.d.ts +32 -100
  83. package/dist/utilities/viewTransition.d.ts +11 -0
  84. package/dist/utilities/viewTransition.spec.d.ts +1 -0
  85. package/package.json +9 -8
  86. package/dist/services/createNavigationIds.d.ts +0 -6
  87. package/dist/services/createRouteViews.d.ts +0 -16
  88. /package/dist/{services/createNavigationIds.spec.d.ts → components/routerProgress.browser.spec.d.ts} +0 -0
@@ -0,0 +1,29 @@
1
+ import { ResolvedRoute } from './resolved';
2
+ import { Routes } from './route';
3
+ import { RedirectStatus } from './router';
4
+ import { RouterPush, RouterPushOptions } from './routerPush';
5
+ import { RouterReplace, RouterReplaceOptions } from './routerReplace';
6
+ import { RouteParamsByKey } from './routeWithParams';
7
+ import { RoutesName } from './routesMap';
8
+ import { RouteStateByName } from './state';
9
+ import { UrlString } from './urlString';
10
+ /**
11
+ * Push and replace as the router itself calls them, which may carry the status a server responds with for
12
+ * the redirect. The router exposes {@link RouterPush} and {@link RouterReplace} instead.
13
+ */
14
+ export type RouterPushOptionsInternal<TState = unknown> = RouterPushOptions<TState> & {
15
+ redirectStatus?: RedirectStatus;
16
+ };
17
+ export type RouterReplaceOptionsInternal<TState = unknown> = RouterReplaceOptions<TState> & {
18
+ redirectStatus?: RedirectStatus;
19
+ };
20
+ export type RouterPushInternal<TRoutes extends Routes> = RouterPush<TRoutes> & {
21
+ <TSource extends RoutesName<TRoutes>>(name: TSource, params: RouteParamsByKey<TRoutes, TSource> | undefined, options: RouterPushOptionsInternal<RouteStateByName<TRoutes, TSource>>): Promise<void>;
22
+ (route: ResolvedRoute, options: RouterPushOptionsInternal): Promise<void>;
23
+ (url: UrlString, options: RouterPushOptionsInternal): Promise<void>;
24
+ };
25
+ export type RouterReplaceInternal<TRoutes extends Routes> = RouterReplace<TRoutes> & {
26
+ <TSource extends RoutesName<TRoutes>>(name: TSource, params: RouteParamsByKey<TRoutes, TSource> | undefined, options: RouterReplaceOptionsInternal<RouteStateByName<TRoutes, TSource>>): Promise<void>;
27
+ (route: ResolvedRoute, options: RouterReplaceOptionsInternal): Promise<void>;
28
+ (url: UrlString, options: RouterReplaceOptionsInternal): Promise<void>;
29
+ };
@@ -1,3 +1,4 @@
1
+ import { NavigationBehavior } from './navigation';
1
2
  import { Routes } from './route';
2
3
  import { RoutesName } from './routesMap';
3
4
  import { RouteParamsByKey } from './routeWithParams';
@@ -6,6 +7,7 @@ import { UrlString } from './urlString';
6
7
  import { AllPropertiesAreOptional } from './utilities';
7
8
  import { QuerySource } from './querySource';
8
9
  import { ResolvedRoute } from './resolved';
10
+ import { ViewTransitionConfig } from './viewTransition';
9
11
  export type RouterPushOptions<TState = unknown> = {
10
12
  /**
11
13
  * The query string to add to the url.
@@ -19,10 +21,16 @@ export type RouterPushOptions<TState = unknown> = {
19
21
  * Whether to replace the current history entry.
20
22
  */
21
23
  replace?: boolean;
24
+ /** Overrides the route and router navigation behavior. */
25
+ navigation?: NavigationBehavior;
22
26
  /**
23
27
  * State values to pass to the route.
24
28
  */
25
29
  state?: Partial<TState>;
30
+ /**
31
+ * Animates the navigation with the View Transitions API. Overrides route and router level viewTransition.
32
+ */
33
+ viewTransition?: ViewTransitionConfig;
26
34
  };
27
35
  type RouterPushArgs<TRoutes extends Routes, TSource extends RoutesName<TRoutes>> = AllPropertiesAreOptional<RouteParamsByKey<TRoutes, TSource>> extends true ? [params?: RouteParamsByKey<TRoutes, TSource>, options?: RouterPushOptions<RouteStateByName<TRoutes, TSource>>] : [params: RouteParamsByKey<TRoutes, TSource>, options?: RouterPushOptions<RouteStateByName<TRoutes, TSource>>];
28
36
  export type RouterPush<TRoutes extends Routes = any> = {
@@ -1,3 +1,4 @@
1
+ import { NavigationBehavior } from './navigation';
1
2
  import { Routes } from './route';
2
3
  import { RoutesName } from './routesMap';
3
4
  import { RouteParamsByKey } from './routeWithParams';
@@ -8,6 +9,8 @@ import { QuerySource } from './querySource';
8
9
  import { ResolvedRoute } from './resolved';
9
10
  export type RouterReplaceOptions<TState = unknown> = {
10
11
  query?: QuerySource;
12
+ /** Overrides the route and router navigation behavior. */
13
+ navigation?: NavigationBehavior;
11
14
  hash?: string;
12
15
  state?: Partial<TState>;
13
16
  };
@@ -29,9 +29,13 @@ export type RouterRoute<TRoute extends ResolvedRoute = ResolvedRoute> = {
29
29
  */
30
30
  readonly update: RouteUpdate<TRoute>;
31
31
  /**
32
- * String value of the resolved URL.
32
+ * String value of the resolved URL. When the route was matched through an alias this is the alias url.
33
33
  */
34
34
  readonly href: TRoute['href'];
35
+ /**
36
+ * String value of the route's own URL. The same as `href` unless the route was matched through an alias.
37
+ */
38
+ readonly canonical: TRoute['canonical'];
35
39
  /**
36
40
  * Title of the route.
37
41
  */
@@ -37,6 +37,11 @@ export type UseLink = {
37
37
  *
38
38
  */
39
39
  isExternal: ComputedRef<boolean>;
40
+ /**
41
+ * True while a view transition to this link's location is in flight, so the elements it animates from
42
+ * can be named before the page is captured.
43
+ */
44
+ isTransitioning: ComputedRef<boolean>;
40
45
  /**
41
46
  * Convenience method for executing `router.push` with route context passed in.
42
47
  */
@@ -0,0 +1,49 @@
1
+ import { ResolvedRoute, RouterResolvedRouteUnion } from './resolved';
2
+ import { CreatedRouteOptions, Routes } from './route';
3
+ /**
4
+ * Types set on a view transition, which css targets with `:active-view-transition-type()`.
5
+ */
6
+ export type ViewTransitionTypes = string[];
7
+ /**
8
+ * The navigation a view transition animates. There is always a route to animate from, since the first
9
+ * navigation never transitions.
10
+ */
11
+ export type ViewTransitionContext = {
12
+ to: ResolvedRoute;
13
+ from: ResolvedRoute;
14
+ };
15
+ /**
16
+ * Decides the types for a navigation. Returning `false` skips the transition for that navigation.
17
+ */
18
+ export type ViewTransitionTypesCallback = (context: ViewTransitionContext) => ViewTransitionTypes | false;
19
+ export type ViewTransitionConfigOptions = {
20
+ /**
21
+ * Types set on the transition, combined with the types of every other level that applies.
22
+ */
23
+ types?: ViewTransitionTypes | ViewTransitionTypesCallback;
24
+ };
25
+ /**
26
+ * Whether a navigation animates with the View Transitions API. A boolean enables or disables the
27
+ * transition, an array of types or an options object enables it.
28
+ */
29
+ export type ViewTransitionConfig = boolean | ViewTransitionTypes | ViewTransitionConfigOptions;
30
+ export type ViewTransitionConfigs = {
31
+ routerViewTransition?: ViewTransitionConfig;
32
+ routeViewTransition?: ViewTransitionConfig;
33
+ navigationViewTransition?: ViewTransitionConfig;
34
+ };
35
+ /**
36
+ * The view transition in flight, from the moment a navigation is decided to transition until its
37
+ * animation finishes. `to` and `from` are known throughout, so the page being left can prepare its elements
38
+ * before it is captured. `transition` is set once the browser has been asked to transition.
39
+ */
40
+ export type RouterViewTransition<TRoutes extends Routes = Routes> = {
41
+ readonly isTransitioning: boolean;
42
+ readonly to: RouterResolvedRouteUnion<TRoutes> | undefined;
43
+ readonly from: RouterResolvedRouteUnion<TRoutes> | undefined;
44
+ readonly types: ViewTransitionTypes;
45
+ readonly transition: ViewTransition | undefined;
46
+ };
47
+ export declare function hasViewTransition(match: CreatedRouteOptions): match is CreatedRouteOptions & {
48
+ viewTransition: ViewTransitionConfig;
49
+ };
@@ -10,9 +10,13 @@ export declare function isAsyncComponent(component: Component): component is Com
10
10
  * Decides which of a route's views to load.
11
11
  */
12
12
  export type AsyncComponentFilter = (match: CreatedRouteOptions, view: RouteView<unknown>) => boolean;
13
+ /**
14
+ * The async components a route renders, or only those the filter keeps.
15
+ */
16
+ export declare function getAsyncComponents(route: ResolvedRoute, filter?: AsyncComponentFilter): ComponentWithAsyncLoader[];
13
17
  /**
14
18
  * Loads the async components a route renders, or only those the filter keeps, so they are ready to render
15
- * synchronously.
19
+ * synchronously. Each load is reported on its own.
16
20
  */
17
- export declare function loadAsyncComponents(route: ResolvedRoute, filter?: AsyncComponentFilter): Promise<unknown>;
21
+ export declare function loadAsyncComponents(route: ResolvedRoute, filter?: AsyncComponentFilter): Promise<unknown>[];
18
22
  export {};
@@ -0,0 +1 @@
1
+ export declare function getRegexMatcher(regex: RegExp): RegExp;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { NavigationBehavior } from '../types/navigation';
2
+ import { ResolvedRoute } from '../types/resolved';
3
+ type NavigationOptions = {
4
+ routerNavigation?: NavigationBehavior;
5
+ routeNavigation?: NavigationBehavior;
6
+ navigation?: NavigationBehavior;
7
+ };
8
+ type NavigationOption = {
9
+ navigation: NavigationBehavior;
10
+ isBlockingNavigation: boolean;
11
+ isProgressiveNavigation: boolean;
12
+ };
13
+ export declare function getRouteNavigationOption(to: ResolvedRoute | null): NavigationBehavior | undefined;
14
+ export declare function getNavigationOption(options: NavigationOptions): NavigationOption;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Encodes the characters in a param value that would otherwise be read as syntax: a percent sign starts
3
+ * an escape, and square brackets mark a param. Everything else is left for the url to encode.
4
+ */
5
+ export declare function encodeParamValue(value: string): string;
6
+ /**
7
+ * Decodes a param value taken from a url. A malformed escape is kept as written rather than thrown on,
8
+ * and a missing value stays missing.
9
+ */
10
+ export declare function decodeParamValue(value: string | undefined): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,5 @@
1
1
  export declare function isPromise(value: unknown): value is Promise<unknown>;
2
+ /**
3
+ * Resolves when the signal aborts, including an already aborted signal.
4
+ */
5
+ export declare function createAbortPromise(signal: AbortSignal): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -14,7 +14,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
14
14
  }>, [Omit<{
15
15
  readonly name: "parentA";
16
16
  readonly path: "/parentA/[paramA]";
17
- }, "meta" | "component" | "components" | "name" | "parent"> & {
17
+ }, "meta" | "name" | "parent"> & {
18
18
  id: string;
19
19
  name: "parentA";
20
20
  meta: Readonly<{}>;
@@ -34,7 +34,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
34
34
  }>, [Omit<{
35
35
  readonly name: "parentA";
36
36
  readonly path: "/parentA/[paramA]";
37
- }, "meta" | "component" | "components" | "name" | "parent"> & {
37
+ }, "meta" | "name" | "parent"> & {
38
38
  id: string;
39
39
  name: "parentA";
40
40
  meta: Readonly<{}>;
@@ -47,7 +47,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
47
47
  }>, [Omit<{
48
48
  readonly name: "parentA";
49
49
  readonly path: "/parentA/[paramA]";
50
- }, "meta" | "component" | "components" | "name" | "parent"> & {
50
+ }, "meta" | "name" | "parent"> & {
51
51
  id: string;
52
52
  name: "parentA";
53
53
  meta: Readonly<{}>;
@@ -56,7 +56,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
56
56
  }]>;
57
57
  readonly name: "parentA.childA";
58
58
  readonly path: "/childA/[?paramB]";
59
- }, "meta" | "component" | "components" | "name" | "parent"> & {
59
+ }, "meta" | "name" | "parent"> & {
60
60
  id: string;
61
61
  name: "parentA.childA";
62
62
  meta: Readonly<{}>;
@@ -76,37 +76,21 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
76
76
  }>, [Omit<{
77
77
  readonly name: "parentA";
78
78
  readonly path: "/parentA/[paramA]";
79
- }, "meta" | "component" | "components" | "name" | "parent"> & {
79
+ }, "meta" | "name" | "parent"> & {
80
80
  id: string;
81
81
  name: "parentA";
82
82
  meta: Readonly<{}>;
83
83
  views: {};
84
84
  loaders: {};
85
- }, Omit<{
86
- readonly parent: import('../types/routeWithMethods').RouteWithMethods<import('../types/url').ToUrl<{
87
- readonly name: "parentA";
88
- readonly path: "/parentA/[paramA]";
89
- }>, [Omit<{
90
- readonly name: "parentA";
91
- readonly path: "/parentA/[paramA]";
92
- }, "meta" | "component" | "components" | "name" | "parent"> & {
93
- id: string;
94
- name: "parentA";
95
- meta: Readonly<{}>;
96
- views: {};
97
- loaders: {};
98
- }]>;
99
- readonly name: "parentA.childB";
100
- readonly path: "/childB/[paramD]";
101
- readonly component: {
102
- template: string;
103
- };
104
- }, "meta" | "component" | "components" | "name" | "parent"> & {
85
+ }, {
86
+ meta: Readonly<{}>;
105
87
  id: string;
106
88
  name: "parentA.childB";
107
- meta: Readonly<{}>;
108
- views: {};
109
89
  loaders: {};
90
+ readonly path: "/childB/[paramD]";
91
+ views: {
92
+ default: import('../types/routeViews').RouteView;
93
+ };
110
94
  }]>, import('../types/routeWithMethods').RouteWithMethods<import('../main').Url<{
111
95
  paramA: {
112
96
  param: StringConstructor;
@@ -126,7 +110,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
126
110
  }>, [Omit<{
127
111
  readonly name: "parentA";
128
112
  readonly path: "/parentA/[paramA]";
129
- }, "meta" | "component" | "components" | "name" | "parent"> & {
113
+ }, "meta" | "name" | "parent"> & {
130
114
  id: string;
131
115
  name: "parentA";
132
116
  meta: Readonly<{}>;
@@ -139,7 +123,7 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
139
123
  }>, [Omit<{
140
124
  readonly name: "parentA";
141
125
  readonly path: "/parentA/[paramA]";
142
- }, "meta" | "component" | "components" | "name" | "parent"> & {
126
+ }, "meta" | "name" | "parent"> & {
143
127
  id: string;
144
128
  name: "parentA";
145
129
  meta: Readonly<{}>;
@@ -148,95 +132,43 @@ export declare const routes: readonly [import('../types/routeWithMethods').Route
148
132
  }]>;
149
133
  readonly name: "parentA.childA";
150
134
  readonly path: "/childA/[?paramB]";
151
- }, "meta" | "component" | "components" | "name" | "parent"> & {
135
+ }, "meta" | "name" | "parent"> & {
152
136
  id: string;
153
137
  name: "parentA.childA";
154
138
  meta: Readonly<{}>;
155
139
  views: {};
156
140
  loaders: {};
157
- }, Omit<{
158
- readonly parent: import('../types/routeWithMethods').RouteWithMethods<import('../main').Url<{
159
- paramA: {
160
- param: StringConstructor;
161
- isOptional: false;
162
- isGreedy: false;
163
- };
164
- paramB: {
165
- param: StringConstructor;
166
- isOptional: true;
167
- isGreedy: false;
168
- };
169
- }>, [Omit<{
170
- readonly name: "parentA";
171
- readonly path: "/parentA/[paramA]";
172
- }, "meta" | "component" | "components" | "name" | "parent"> & {
173
- id: string;
174
- name: "parentA";
175
- meta: Readonly<{}>;
176
- views: {};
177
- loaders: {};
178
- }, Omit<{
179
- readonly parent: import('../types/routeWithMethods').RouteWithMethods<import('../types/url').ToUrl<{
180
- readonly name: "parentA";
181
- readonly path: "/parentA/[paramA]";
182
- }>, [Omit<{
183
- readonly name: "parentA";
184
- readonly path: "/parentA/[paramA]";
185
- }, "meta" | "component" | "components" | "name" | "parent"> & {
186
- id: string;
187
- name: "parentA";
188
- meta: Readonly<{}>;
189
- views: {};
190
- loaders: {};
191
- }]>;
192
- readonly name: "parentA.childA";
193
- readonly path: "/childA/[?paramB]";
194
- }, "meta" | "component" | "components" | "name" | "parent"> & {
195
- id: string;
196
- name: "parentA.childA";
197
- meta: Readonly<{}>;
198
- views: {};
199
- loaders: {};
200
- }]>;
201
- readonly name: "parentA.childA.grandChildA";
202
- readonly path: "/[paramC]";
203
- readonly component: {
204
- template: string;
205
- };
206
- }, "meta" | "component" | "components" | "name" | "parent"> & {
141
+ }, {
142
+ meta: Readonly<{}>;
207
143
  id: string;
208
144
  name: "parentA.childA.grandChildA";
209
- meta: Readonly<{}>;
210
- views: {};
211
145
  loaders: {};
146
+ readonly path: "/[paramC]";
147
+ views: {
148
+ default: import('../types/routeViews').RouteView;
149
+ };
212
150
  }]>, import('../types/routeWithMethods').RouteWithMethods<import('../types/url').ToUrl<{
213
151
  readonly name: "parentB";
214
152
  readonly path: "/parentB";
215
- }>, [Omit<{
216
- readonly name: "parentB";
217
- readonly path: "/parentB";
218
- readonly component: {
219
- template: string;
220
- };
221
- }, "meta" | "component" | "components" | "name" | "parent"> & {
153
+ }>, [{
154
+ meta: Readonly<{}>;
222
155
  id: string;
223
156
  name: "parentB";
224
- meta: Readonly<{}>;
225
- views: {};
226
157
  loaders: {};
158
+ readonly path: "/parentB";
159
+ views: {
160
+ default: import('../types/routeViews').RouteView;
161
+ };
227
162
  }]>, import('../types/routeWithMethods').RouteWithMethods<import('../types/url').ToUrl<{
228
163
  readonly name: "parentC";
229
164
  readonly path: "/";
230
- }>, [Omit<{
231
- readonly name: "parentC";
232
- readonly path: "/";
233
- readonly component: {
234
- template: string;
235
- };
236
- }, "meta" | "component" | "components" | "name" | "parent"> & {
165
+ }>, [{
166
+ meta: Readonly<{}>;
237
167
  id: string;
238
168
  name: "parentC";
239
- meta: Readonly<{}>;
240
- views: {};
241
169
  loaders: {};
170
+ readonly path: "/";
171
+ views: {
172
+ default: import('../types/routeViews').RouteView;
173
+ };
242
174
  }]>];
@@ -0,0 +1,11 @@
1
+ import { ViewTransitionConfigs, ViewTransitionContext, ViewTransitionTypes } from '../types/viewTransition';
2
+ /**
3
+ * The types to transition with, or `false` when the navigation should not transition. The nearest level
4
+ * that sets the option decides whether it is on, and the types of every level that is on are combined.
5
+ */
6
+ export declare function getViewTransitionTypes({ routerViewTransition, routeViewTransition, navigationViewTransition, ...context }: ViewTransitionConfigs & ViewTransitionContext): ViewTransitionTypes | false;
7
+ export declare function supportsViewTransitions(): boolean;
8
+ /**
9
+ * Passing types to a browser that predates them throws, so they are only passed where a transition has them.
10
+ */
11
+ export declare function supportsViewTransitionTypes(): boolean;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kitbag/router",
3
3
  "private": false,
4
- "version": "0.26.1",
4
+ "version": "0.28.0",
5
5
  "license": "MIT",
6
6
  "bugs": {
7
7
  "url": "https://github.com/kitbagjs/router/issues"
@@ -45,21 +45,22 @@
45
45
  "devDependencies": {
46
46
  "@kitbag/eslint-config": "1.0.6",
47
47
  "@vitejs/plugin-vue": "^6.0.8",
48
- "@vue/language-core": "^3.3.11",
49
- "@vue/test-utils": "^2.5.0",
50
- "arktype": "^2.2.3",
48
+ "@vue/language-core": "^3.3.12",
49
+ "@vue/test-utils": "^2.5.1",
50
+ "arktype": "^2.2.8",
51
51
  "eslint": "^9.39.5",
52
- "globals": "^17.12.0",
53
- "happy-dom": "^20.14.3",
52
+ "globals": "^17.13.0",
53
+ "happy-dom": "^20.14.6",
54
54
  "typedoc": "^0.28.20",
55
- "typedoc-plugin-markdown": "^4.13.0",
55
+ "typedoc-plugin-markdown": "^4.13.1",
56
56
  "typedoc-vitepress-theme": "^1.1.4",
57
57
  "typescript": "^6.0.3",
58
58
  "valibot": "^1.0.0",
59
+ "view-transitions-mock": "^1.1.0",
59
60
  "vite": "^8.2.0",
60
61
  "vite-plugin-dts": "^5.0.3",
61
62
  "vitepress": "^1.6.4",
62
- "vitest": "^5.0.0",
63
+ "vitest": "^5.0.3",
63
64
  "vue-tsc": "^3.3.8",
64
65
  "zod": "4.0.0"
65
66
  },
@@ -1,6 +0,0 @@
1
- export type NavigationIds = {
2
- getNavigationId: () => string;
3
- isCurrentNavigationId: (id: string) => boolean;
4
- stopNavigationIds: () => void;
5
- };
6
- export declare function createNavigationIds(): NavigationIds;
@@ -1,16 +0,0 @@
1
- import { CreateRouteOptions, CreateRouteProps } from '../types/createRouteOptions';
2
- import { RouteViews } from '../types/routeViews';
3
- export declare const DEFAULT_VIEW_NAME = "default";
4
- /**
5
- * Builds the initial views for a route, seeding components from the (deprecated) `component`/`components`
6
- * options and prop getters from the props argument. Subsequent views are added via the route's `addView`.
7
- *
8
- * This is where the props argument's two shapes — a single getter for the unnamed view, or a record keyed
9
- * by view name — are normalized, so the rest of the router only deals with views keyed by name.
10
- */
11
- export declare function createRouteViews(options: CreateRouteOptions, props?: CreateRouteProps): RouteViews;
12
- /**
13
- * The names of the views that have a props getter. A view without one is never computed, so waiting on it
14
- * would never settle.
15
- */
16
- export declare function viewNamesWithProps(views: RouteViews): string[];