import { Controller } from './models/controller' ; import { Middleware } from './models/middleware' ; export default class Route { private _method : string ; private _path : string ; private _name : string | undefined ; private _constraints : { [ key ] : string ; } | undefined ; private _middleware : Middleware [ ] ; private _context : any ; private _controller : Controller ; constructor ( method , path , controller ) { this . _method = method ; this . _path = path ; this . _controller = controller ; } get method ( ) : string { return this . _method ; } get path ( ) : string { return this . _path ; } get controller ( ) : Controller { return this . _controller ; } get middleware ( ) : Middleware [ ] { return this . _middleware || [ ] ; } set middleware ( value ) { this . _middleware = value ; } get context ( ) : any { return this . _context ; } set context ( value ) { this . _context = value ; } get name ( ) : string | undefined { return this . _name ; } set name ( value ) { this . _name = value ; } public where ( constraints ) { this . _constraints = constraints ; } public getConstraints ( ) { return this . _constraints ; } } ;