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.50 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.49 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.48 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.47 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.46 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.45 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.44 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.43 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.42 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.41 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.40 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.39 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.38 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.37 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.36 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.35 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.34 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.33 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.32 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.31 node_modules/wouter-preact/matcher.d.ts