import { createHashHistory, createBrowserHistory, createMemoryHistory,
// MemoryHistoryBuildOptions,
 } from 'history';
import { runtime } from './adapter';
// 显式声明HASH 或 app 的 路由使用 hash router，而其他web应用使用 BrowserRouter
const createHistory = (options, type = 'browser') => {
    let history;
    switch (type) {
        case 'hash':
        case 'HASH':
            history = createHashHistory(Object.assign({ basename: '' }, options));
            break;
        case 'memory':
        case 'MEMORY':
            history = createMemoryHistory();
            break;
        default:
            history = createBrowserHistory(options);
    }
    runtime._WEAPPS_HISTORY = history;
    return history;
};
const removeHistory = () => {
    runtime._WEAPPS_HISTORY = undefined;
};
export { createHistory, removeHistory };
