|
|
|
import AppClass from '../../lifecycle/AppClass.ts'
|
|
|
|
import {Route, RouteParameters} from './Route.ts'
|
|
|
|
import {RouteHandlers} from '../../unit/Routing.ts'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class representing a route mounted to a request.
|
|
|
|
* @extends AppClass
|
|
|
|
*/
|
|
|
|
export default class ActivatedRoute extends AppClass {
|
|
|
|
/**
|
|
|
|
* The incoming parameters parsed from the route.
|
|
|
|
* @type RouteParameters
|
|
|
|
*/
|
|
|
|
public readonly params: RouteParameters
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
/**
|
|
|
|
* The incoming route path string.
|
|
|
|
* @type string
|
|
|
|
*/
|
|
|
|
public readonly incoming: string,
|
|
|
|
/**
|
|
|
|
* The matched route.
|
|
|
|
* @type Route
|
|
|
|
*/
|
|
|
|
public readonly route: Route,
|
|
|
|
/**
|
|
|
|
* The handlers for this route.
|
|
|
|
* @type RouteHandlers | undefined
|
|
|
|
*/
|
|
|
|
public readonly handlers: RouteHandlers | undefined,
|
|
|
|
) {
|
|
|
|
super()
|
|
|
|
this.params = route.build_parameters(incoming)
|
|
|
|
}
|
|
|
|
}
|