import { PathMatchParams } from "./path"; export interface PathMatch { params: PathMatchParams; matchedSegments: string[]; remainingSegments?: string[]; value: T; } /** * Path matcher which support :param and *wildcard segments. * The wildcard segment is only supported as the last segment */ export declare class PathMatcher { tree: RootSegmentNode; loadMapping(mapping: Record): void; addPath(path: string, value: T): void; addSegments(segments: string[], value: T): void; match(path: string | string[]): PathMatch | null; } interface SegmentNode { name: string; value?: T | undefined; match(segment: string, params: PathMatchParams): SegmentNode | null; } declare class ParentSegmentNode implements SegmentNode { name: string; value?: T | undefined; children: Record>; wildcard?: SegmentNode; constructor(name: string, value?: T | undefined); match(segment: string, params: PathMatchParams): SegmentNode | null; } declare class RootSegmentNode extends ParentSegmentNode { constructor(); } export {}; //# sourceMappingURL=PathMatcher.d.ts.map