/** * Function which, given a path with leading slashes removed, tells me which index to consume until. * * Returning -1 if nothing can be consumed (e.g. path is empty, not long enough, etc.) */ export type PathConsumer = (pathNoLeadingSlashes: string) => number; export type Consumed = { captured: string; consumed: string; remaining: string; }; /** * 1. consume leading slashes from path * 2. use consumer to capture some substring of what's left, e.g. everything until the index of the first '/' */ export declare function consume(path: string, consumer: PathConsumer): Consumed | undefined; export declare function upToChars(count: number): (path: string) => number; export declare function exactlyChars(count: number): (path: string) => number; export declare function upToSegments(count: number): (path: string) => number; export declare function exactlySegments(count: number): (path: string) => number; export declare function nextSlashOrEnd(path: string): number; export declare function endOfPath(path: string): number; //# sourceMappingURL=consume.d.ts.map