module import { createBrowserHistory , createHashHistory } from 'history' ; /**
 * History modes.
 */ enum HISTORY_MODE { /** History mode. */ HISTORY = 'HISTORY' , /** Hash mode. */ HASH = 'HASH' } /**
 * History actions.
 */ enum HISTORY_ACTION { /** Push into location. */ PUSH = 'PUSH' , /** Replace in location. */ REPLACE = 'REPLACE' , /** Pop from the location. */ POP = 'POP' } ; /**
 * History hash types
 */ enum HASH_TYPE { /** The default. */ SLASH = 'SLASH' , /** Omit the leading slash. */ NOSLASH = 'NOSLASH' , /** Google's legacy AJAX URL format. */ HASHBANG = 'HASHBANG' } ; param { HISTORY_MODE } mode param { object } opts return { object } const history = ( mode , opts ) : object => { opts = opts || { } ; switch ( mode ) { case HISTORY_MODE . HISTORY : return createBrowserHistory ( opts ) ; case HISTORY_MODE . HASH : default : return createHashHistory ( opts ) ; } } ; export { HISTORY_MODE , HISTORY_ACTION , HASH_TYPE , } ; export default history ;