]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: remove last ts errors
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Jan 2025 11:34:34 +0000 (12:34 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Jan 2025 11:34:34 +0000 (12:34 +0100)
packages/router/src/experimental/router.ts

index 09e7a46af5281fb76370260166c44e2b228ad155..32f8a0f0f20708e65fe618a79e285bf8d6ff673b 100644 (file)
@@ -90,6 +90,12 @@ import {
  */
 export type _OnReadyCallback = [() => void, (reason?: any) => void]
 
+// NOTE: we could override each type with the new matched array but this would
+// interface RouteLocationResolved<Name extends keyof RouteMap = keyof RouteMap>
+//   extends Omit<_RouteLocationResolved<Name>, 'matched'> {
+//   matched: EXPERIMENTAL_RouteRecordNormalized[]
+// }
+
 /**
  * Options to initialize a {@link Router} instance.
  */
@@ -548,8 +554,10 @@ export function experimental_createRouter(
     // }
 
     const matchedRoute = matcher.resolve(
+      // FIXME: should be ok
+      // @ts-expect-error: too many overlads
       rawLocation,
-      currentLocation satisfies NEW_LocationResolved<EXPERIMENTAL_RouteRecordNormalized>
+      currentLocation
     )
     const href = routerHistory.createHref(matchedRoute.fullPath)
 
@@ -564,8 +572,8 @@ export function experimental_createRouter(
       }
     }
 
-    // TODO: can this be refactored at the very end
     // matchedRoute is always a new object
+    // @ts-expect-error: the `matched` property is different
     return assign(matchedRoute, {
       redirectedFrom: undefined,
       href,