import {join} from "./Joined"; import {literal} from "./Literal"; import {PathMatcher} from "./PathMatcher"; import {SegmentsFn, VariablePaths, variablesPath} from "./variables"; export function path(literal: string): PathMatcher<{}> ; export function path(vars: VariablePaths, segmentFn: SegmentsFn): PathMatcher; export function path(a: PathMatcher, b: PathMatcher): PathMatcher; export function path(a: PathMatcher, b: PathMatcher, c: PathMatcher): PathMatcher; export function path(a: PathMatcher, b: PathMatcher, c: PathMatcher, d: PathMatcher): PathMatcher; export function path(a: PathMatcher, b: PathMatcher, c: PathMatcher, d: PathMatcher, e: PathMatcher): PathMatcher; export function path(...segments: PathMatcher[]): PathMatcher; export function path( first: string | VariablePaths | PathMatcher, second?: SegmentsFn | PathMatcher, ...rest: PathMatcher[]) : PathMatcher | PathMatcher { if (typeof first === "string") return literal(first); if (typeof second === "function") return variablesPath(first as VariablePaths, second); return join(first as PathMatcher, second as PathMatcher, ...rest as PathMatcher[]); }