Skip to content

Commit 02c56fe

Browse files
Merge pull request #809 from tighten/strict-route-name-type-fix
Fix `current()` type in strict mode
2 parents 2b574ba + d4dadbc commit 02c56fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ interface ParsedQs {
170170
* Ziggy's Router class.
171171
*/
172172
interface Router {
173-
current(): RouteName | undefined;
174-
current<T extends RouteName>(name: T, params?: ParameterValue | RouteParams<T>): boolean;
173+
current(): ValidRouteName | undefined;
174+
current<T extends ValidRouteName>(name: T, params?: ParameterValue | RouteParams<T>): boolean;
175175
get params(): Record<string, string>;
176176
get routeParams(): Record<string, string>;
177177
get queryParams(): ParsedQs;
178-
has<T extends RouteName>(name: T): boolean;
178+
has<T extends ValidRouteName>(name: T): boolean;
179179
}
180180

181181
/**

0 commit comments

Comments
 (0)