DefinitelyTyped/types/feather-route-matcher/index.d.ts
2019-07-01 11:14:20 -07:00

23 lines
569 B
TypeScript

// Type definitions for feather-route-matcher 3.1
// Project: https://github.com/henrikjoreteg/feather-route-matcher
// Definitions by: Eugeny Schibrikov <https://github.com/sHooKDT>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface RouteConfig<T> {
[path: string]: T;
}
interface Match<T> {
page: T;
url: string;
params: { [key: string]: string } | null;
}
interface Matcher<T> {
(path: string): Match<T>;
}
declare function createMatcher<T>(config: RouteConfig<T>): Matcher<T>;
export { createMatcher as default };