import type { Navigation , HistoryOptions , NavigationType } from '../types' ; import type { RouteTree } from '../tree/tree' ; export type Listener = ( arg : { url : string ; type ? : NavigationType ; navigateState ? : any ; replace ? : boolean ; history ? : boolean ; } ) => Promise < void > ; export abstract class History { protected listener ? : Listener ; protected tree ? : RouteTree ; init ( navigation ) { } abstract save ( navigation ) ; abstract go ( to , options ? ) ; listen ( listener ) { this . listener = listener ; } setTree ( tree ) { this . tree = tree ; } }