Skip to content

Commit

Permalink
chore: remove last ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 8, 2025
1 parent 49ee966 commit 1f717fb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/router/src/experimental/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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)

Expand All @@ -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,
Expand Down

0 comments on commit 1f717fb

Please sign in to comment.