The type of the incoming event.
The type of the outgoing response.
Creates a new Route instance.
The type of the incoming event.
The type of the outgoing response.
Configuration options for the route.
A new Route instance.
Gets the hostname of the route.
The hostname as a string.
Gets the hash fragment from the event URL.
The hash fragment as a string.
Gets the pathname of the route.
The pathname as a string.
Gets the protocol for the route.
The protocol as a string (http or https).
Gets the query parameters from the event URL.
A record of query parameters.
Gets the full URI of the route.
The full URI as a string.
Gets the URL of the event.
The event URL or a default URL (http://localhost).
Adds a middleware to the route.
The middleware to add.
The updated Route instance.
Binds the provided event to the route, initializing route parameters and query data.
The incoming event to bind to the route.
A promise that resolves once the binding is complete.
Generates a URL or URI for the route with optional parameters, query, hash, and protocol.
Options for generating the URL.
params: Route parameters to include in the path.query: Query parameters to append to the URL.hash: A hash fragment to include in the URL.withDomain: Whether to include the domain in the URL.protocol: The protocol to use in the URL.The generated URL as a string.
Retrieves all parameters that are defined (non-undefined values).
A record of defined parameters.
Returns the compiled regex matching the domain, or undefined when the route
has no domain constraint.
The precompiled domain regex or undefined.
Retrieves a specified option from the route configuration.
The key of the option to retrieve.
The value of the option or the fallback value if not found.
Retrieves a specified option from the route configuration.
The key of the option to retrieve.
A fallback value if the option is not found.
The value of the option or the fallback value if not found.
Retrieves the names of all optional parameters.
An array of optional parameter names.
Retrieves a specified options from the route configuration.
The kesy of the option to retrieve.
The values of the option.
Retrieves the value of a specific parameter.
The name of the parameter to retrieve.
The value of the parameter or the fallback value if not found.
Retrieves the names of all parameters.
An array of parameter names.
Returns the compiled regex matching the path only.
The precompiled path regex.
Computes a deterministic specificity score for the route.
Higher is more specific. Static segments outrank required parameters, which
outrank optional parameters, which outrank catch-all (*/+) wildcards. This
lets the collection order routes by specificity independently of their
declaration order (e.g. /users/new wins over /users/:id).
The specificity score.
Returns the compiled regex matching the full URI (domain + path).
Used to extract parameter values via named capture groups.
The precompiled URI regex.
Checks if the route has a domain constraint.
true if the route has a domain constraint, otherwise false.
Checks if the route has a specific parameter.
The name of the parameter to check.
true if the parameter exists, otherwise false.
Checks if the route has any parameters.
true if parameters are present, otherwise false.
Checks if the route is marked as a fallback route.
true if the route is a fallback, otherwise false.
Checks if the route uses HTTP protocol.
true if the route is HTTP-only, otherwise false.
Checks if the route uses HTTPS protocol.
true if the route is HTTPS-only, otherwise false.
Determines if a specific middleware is excluded from execution.
The middleware to check.
true if the middleware is excluded, otherwise false.
Checks if a parameter name is optional.
The name of the parameter to check.
true if the parameter is optional, otherwise false.
Checks if the route requires HTTPS for security.
true if the route is HTTPS-only, otherwise false.
Checks if the route operates in strict mode.
true if the route is strict, otherwise false.
Checks if the provided event matches the route.
The incoming event to check against the route.
Whether to include HTTP method matching in the evaluation.
true if the event matches the route, otherwise false.
Executes the route's action based on the provided event.
Note: The order of execution is important and should not be changed.
The incoming event to handle.
A promise that resolves to the outgoing response generated by the route's action.
Sets the dispatchers for handling callable or handler actions.
The dispatchers to set.
The updated Route instance.
Sets the matchers to use for evaluating if an event matches the route.
An array of matchers to set.
The updated Route instance.
Sets the resolver for the route. The resolver is used to resolve the route's handler.
Optionalresolver: DependencyResolver
The resolver to set.
The updated Route instance.
Converts the route into a JSON object representation.
A JSON object representing the route.
Converts the route into a string representation (JSON format).
A JSON string representing the route.
StaticcreateFactory method for creating a route instance.
Configuration options for the route.
A new Route instance.
Represents a route that defines how incoming events are handled.