Sha256: b1c45606e54e6d6cd53b70b5cfc723db0f52ae179db3ac140036e31976bc073f

Contents?: true

Size: 707 Bytes

Versions: 81

Compression:

Stored size: 707 Bytes

Contents

/*
 * Match and params
 */

import { Path } from "./use-location";

export interface DefaultParams {
  [paramName: string]: string;
}
export type Params<T extends DefaultParams = DefaultParams> = T;

export type MatchWithParams<T extends DefaultParams = DefaultParams> = [
  true,
  Params<T>
];
export type NoMatch = [false, null];
export type Match<T extends DefaultParams = DefaultParams> =
  | MatchWithParams<T>
  | NoMatch;

export type MatcherFn = (pattern: Path, path: Path) => Match;

export type PatternToRegexpResult = {
  keys: Array<{ name: string | number }>;
  regexp: RegExp;
};

export default function makeMatcher(
  makeRegexpFn?: (pattern: string) => PatternToRegexpResult
): MatcherFn;

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
isomorfeus-preact-10.6.10 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.9 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.8 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.7 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.6 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.5 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.4 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.3 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.2 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.1 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.0 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.11 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.10 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.9 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.8 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.7 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.6 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.5 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.4 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.5.3 node_modules/wouter-preact/matcher.d.ts