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.9.0 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.8.2 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.8.1 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.8.0 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.7.3 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.7.2 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.7.1 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.7.0 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.62 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.61 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.60 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.59 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.58 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.57 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.56 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.55 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.54 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.53 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.52 node_modules/wouter-preact/matcher.d.ts
isomorfeus-preact-10.6.51 node_modules/wouter-preact/matcher.d.ts