Skip to content

Commit

Permalink
Merge pull request #809 from tighten/strict-route-name-type-fix
Browse files Browse the repository at this point in the history
Fix `current()` type in strict mode
  • Loading branch information
bakerkretzmar authored Jan 31, 2025
2 parents 2b574ba + d4dadbc commit 02c56fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ interface ParsedQs {
* Ziggy's Router class.
*/
interface Router {
current(): RouteName | undefined;
current<T extends RouteName>(name: T, params?: ParameterValue | RouteParams<T>): boolean;
current(): ValidRouteName | undefined;
current<T extends ValidRouteName>(name: T, params?: ParameterValue | RouteParams<T>): boolean;
get params(): Record<string, string>;
get routeParams(): Record<string, string>;
get queryParams(): ParsedQs;
has<T extends RouteName>(name: T): boolean;
has<T extends ValidRouteName>(name: T): boolean;
}

/**
Expand Down

0 comments on commit 02c56fe

Please sign in to comment.