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 CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.0.0-rc.1",
6
6
  "bridge": false
7
7
  },
8
- "version": "2.1.3"
8
+ "version": "2.1.4"
9
9
  }
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 TypedRouteLocationRaw = RouteQueryAndHash & TypedRouteNamedMapper & RouteLocationOptions;
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 { ResolvedTypedLocationAsRelativeRaw, TypedNamedRoute } from './__router';
355
+ import type { TypedNamedRouteLocation } from './__router';
350
356
  import { TypedRouteList } from './__routes';
351
357
 
352
358
  export const navigateTo: <T extends TypedRouteList>(
353
- to: ResolvedTypedLocationAsRelativeRaw<T>,
359
+ to: TypedNamedRouteLocation<T>,
354
360
  options?: NavigateToOptions
355
361
  ) => Promise<void | NavigationFailure | TypedNamedRoute<T>> = defaultNavigateTo as any;
356
362
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-typed-router",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Provide autocompletion for pages route names generated by Nuxt router",
5
5
  "type": "module",
6
6
  "main": "./dist/module.cjs",