nuxt-typed-router 2.1.3 → 2.1.4
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/dist/module.json +1 -1
- package/dist/module.mjs +9 -3
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -277,7 +277,13 @@ function createRuntimeRouterTypes() {
|
|
|
277
277
|
name?: T;
|
|
278
278
|
} & ([TypedRouteParams[T]] extends [never] ? {} : { params: TypedRouteParams[T] });
|
|
279
279
|
|
|
280
|
-
type
|
|
280
|
+
export type TypedNamedRouteLocation<T extends TypedRouteList> =
|
|
281
|
+
| (Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & TypedLocationAsRelativeRaw<T>)
|
|
282
|
+
| string;
|
|
283
|
+
|
|
284
|
+
type TypedRouteLocationRaw =
|
|
285
|
+
| (Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & TypedRouteNamedMapper)
|
|
286
|
+
| string;
|
|
281
287
|
|
|
282
288
|
type _TypedRoute = Omit<RouteLocationNormalizedLoaded, 'name' | 'params'> &
|
|
283
289
|
ResolvedTypedRouteNamedMapper;
|
|
@@ -346,11 +352,11 @@ function createRuntimeNavigateToFunction() {
|
|
|
346
352
|
import { navigateTo as defaultNavigateTo } from '#app';
|
|
347
353
|
import { NavigateToOptions } from 'nuxt/dist/app/composables/router';
|
|
348
354
|
import { NavigationFailure } from 'vue-router';
|
|
349
|
-
import type {
|
|
355
|
+
import type { TypedNamedRouteLocation } from './__router';
|
|
350
356
|
import { TypedRouteList } from './__routes';
|
|
351
357
|
|
|
352
358
|
export const navigateTo: <T extends TypedRouteList>(
|
|
353
|
-
to:
|
|
359
|
+
to: TypedNamedRouteLocation<T>,
|
|
354
360
|
options?: NavigateToOptions
|
|
355
361
|
) => Promise<void | NavigationFailure | TypedNamedRoute<T>> = defaultNavigateTo as any;
|
|
356
362
|
|