import { PathMatchParams } from "./path";
export interface PathMatch<T = any> {
    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<T = any> {
    tree: RootSegmentNode;
    loadMapping(mapping: Record<string, T>): void;
    addPath(path: string, value: T): void;
    addSegments(segments: string[], value: T): void;
    match(path: string | string[]): PathMatch<T> | null;
}
interface SegmentNode<T = any> {
    name: string;
    value?: T | undefined;
    match(segment: string, params: PathMatchParams): SegmentNode<T> | null;
}
declare class ParentSegmentNode<T = any> implements SegmentNode<T> {
    name: string;
    value?: T | undefined;
    children: Record<string, SegmentNode<T>>;
    wildcard?: SegmentNode<T>;
    constructor(name: string, value?: T | undefined);
    match(segment: string, params: PathMatchParams): SegmentNode<T> | null;
}
declare class RootSegmentNode<T = any> extends ParentSegmentNode<T> {
    constructor();
}
export {};
//# sourceMappingURL=PathMatcher.d.ts.map