/* * Match and params */ import { Path } from "./use-location"; export interface DefaultParams { [paramName: string]: string; } export type Params = T; export type MatchWithParams = [ true, Params ]; export type NoMatch = [false, null]; export type Match = | MatchWithParams | NoMatch; export type MatcherFn = (pattern: Path, path: Path) => Match; export interface PatternToRegexpResult { keys: Array<{ name: string | number }>; regexp: RegExp; } export default function makeMatcher( makeRegexpFn?: (pattern: string) => PatternToRegexpResult ): MatcherFn;