The constructor for the RouteResult
class.
The result of the route evaluation.
The comprehensive result of routing evaluation that rendered this route.
This object contains all the information gathered during the route matching process, including path evaluation, querystring parsing, component resolution, and status determination.
Optional
component?: anyThe component that was resolved and rendered when the route became active.
This represents the actual component instance, snippet, or component factory that was determined during the routing process. It can be a direct component reference, a lazy-loaded component function, or a Svelte snippet.
The path evaluation results containing the matched path information.
This object provides detailed information about how the current URL path was matched against the route's path pattern, including any extracted parameters.
The evaluation condition indicating how the path was matched.
Condition For available condition types
The original path string that was evaluated during routing.
This represents the actual path portion of the URL that was processed, without query parameters or hash fragments.
Optional
params?: ReturnParamThe parameters extracted from the path during evaluation.
Contains named parameters extracted from the path pattern matching,
such as route parameters defined with :paramName
syntax or regex groups.
// For route "/users/:id" matching "/users/123"
params: { id: "123" }
// For regex route "^/posts/(?<slug>.+)$" matching "/posts/my-article"
params: { slug: "my-article" }
ReturnParam For parameter value types
The querystring evaluation results containing parsed query parameters.
This object provides information about how the URL's query string was processed and any parameters that were extracted or matched.
The evaluation condition indicating how the querystring was matched.
Condition For available condition types
The original querystring data that was evaluated during routing.
This can be either a parsed object representation of query parameters or the raw querystring, depending on how the route was configured.
ReturnParam For supported parameter types
Optional
params?: ReturnParamThe parameters extracted from the querystring during evaluation.
Contains the processed query parameters after applying any route-specific querystring matching rules and transformations.
ReturnParam For parameter value types
The HTTP-style status code representing the result of the routing operation.
This numeric code indicates the outcome of the route evaluation process, following HTTP status code conventions for consistency and familiarity. The status helps determine how the route result should be handled by status handlers and middleware.
Optional
routeThe route that was evaluated to render this result.
A route result that includes the evaluation results of the route.
This type is necessary for the internal workings of the router to ensure that the evaluation results are included in the route result and to avoid requiring it to be merged in the original route instance.
Since
2.0.0
Example