import {Result} from "@http4t/result"; export type Matched = { value: T, remaining: string }; export type PathError = { message: string, remaining: string } export type PathResult = Result>; export interface PathMatcher { consume(path: string): PathResult; expand(value: T): string; } export function isPathMatcher(value: any): value is PathMatcher { return typeof value['consume'] === 'function' && typeof value['expand'] === 'function' }