Interface RouteMatcher<TRoute>

Route fragment matcher.

Type Parameters

Hierarchy

  • RouteMatcher

Methods

Methods

  • Searches for the fragment of the route satisfying this matcher's conditions.

    In contrast to the test method this one attempts to find the matching fragment starting at some offset from current position specified by context, and then tries to match the remaining path against the remaining pattern.

    The matching route fragment always starts within current route entry.

    Parameters

    • context: Context<TRoute>

      Route match context.

    Returns undefined | null | false | readonly [RouteMatch, number]

    A tuple containing a match of the remaining path against the remaining pattern and an offset within current entry name the matching route fragment starts at, or false/null/undefined if match not found.

  • Detects whether this matcher still matches after the end of the route.

    Parameters

    • context: TailContext<TRoute>

      Route tail match context.

    Returns boolean

    true if the route satisfies this matcher's condition, or false otherwise.

  • Tests whether a fragment of the route satisfying this matcher's conditions.

    Parameters

    • context: Context<TRoute>

      Route match context.

    Returns undefined | null | false | Match<TRoute>

    Route match instance specifying a matching route fragment, or false/null/undefined otherwise.

Generated using TypeDoc