import { Query , default as BaseRouter } from './container-router/BaseRouter' ; import IRoute from './IRoute' ; export default abstract class Route implements IRoute { public path : string | null = null ; public query : Query = { } ; protected abstract route : BaseRouter ; protected removeChangeListener : ( ( ) => void ) | undefined ; public start ( ) { this . removeChangeListener = this . route . addChangeListener ( ( path , query ) => { this . path = path ; this . query = query ; } ) ; } public destroy ( ) { if ( this . removeChangeListener ) { this . removeChangeListener ( ) ; } this . route . destroy ( ) ; } public redirect ( url , params ? ) { this . route . redirect ( url , params ) ; } public back ( n , defaultUrl = '' ) { this . route . back ( n , defaultUrl ) ; } public backTo ( url , options ) { this . route . backTo ( url , options ) ; } public replace ( url , params ? ) { this . route . replace ( url , params ) ; } public pushWindow ( url , params ? ) { this . route . pushWindow ( url , params ) ; } public popWindow ( ) { this . route . popWindow ( ) ; } public popTo ( delta ) { this . route . popTo ( delta ) ; } }