Skip to content

Commit

Permalink
Update Parser type for optional loose arg
Browse files Browse the repository at this point in the history
The default parser accepts this, and behaves differently when it's passed (e.g., it's needed for nested routes) so it seems useful to include in typing.
  • Loading branch information
bensaufley committed Nov 11, 2024
1 parent f2e3b8d commit 32ebe04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/wouter/types/router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import {
BaseSearchHook,
} from "./location-hook.js";

export type Parser = (route: Path) => { pattern: RegExp; keys: string[] };
export type Parser = (
route: Path,
loose?: boolean
) => { pattern: RegExp; keys: string[] };

export type HrefsFormatter = (href: string, router: RouterObject) => string;

Expand Down

0 comments on commit 32ebe04

Please sign in to comment.