//#region src/matchPath.d.ts type _PathParam = Path extends `${infer L}/${infer R}` ? _PathParam | _PathParam : Path extends `:${infer Param}` ? Param extends `${infer Optional}?` ? Optional : Param : never; type PathParam = Path extends '*' | '/*' ? '*' : Path extends `${infer Rest}/*` ? '*' | _PathParam : _PathParam; type ParamParseKey = [PathParam] extends [never] ? string : PathParam; /** A PathPattern is used to match on some portion of a URL pathname. */ interface PathPattern { /** * A string to match against a URL pathname. May contain `:id`-style segments * to indicate placeholders for dynamic parameters. May also end with `/*` to * indicate matching the rest of the URL pathname. */ path: Path; /** * Should be `true` if the static portions of the `path` should be matched in * the same case. */ caseSensitive?: boolean; /** Should be `true` if this pattern should match the entire URL pathname. */ end?: boolean; } /** The parameters that were parsed from the URL path. */ type Params = { readonly [key in Key]: string | undefined }; type PathMatchGlob = { matchPath: , Path extends string>(pattern: PathPattern | Path) => PathMatch | null; path: string; }; /** A PathMatch contains info about how a PathPattern matched on a URL pathname. */ interface PathMatch { /** The names and values of dynamic parameters in the URL. */ params: Params; /** The portion of the URL pathname that was matched. */ pathname: string; /** The portion of the URL pathname that was matched before child routes. */ pathnameBase: string; /** The pattern that was used to match. */ pattern: PathPattern; glob: null | PathMatchGlob; } /** * Performs pattern matching on a URL pathname and returns information about the * match. * * @see https://reactrouter.com/utils/match-path */ declare function matchPath, Path extends string>(pattern: PathPattern | Path, pathname: string): PathMatch | null; declare function matchPathWith(path: string | undefined | null): { patterns: (patterns: Record R$1>) => R$1 | null; }; //#endregion export { ParamParseKey, Params, PathMatch, PathMatchGlob, PathParam, PathPattern, matchPath, matchPathWith };