import { __assign } from "tslib";
import { createHashHistory, createBrowserHistory, createMemoryHistory, } from 'history';
import { runtime } from './adapter';
// 显式声明HASH 或 app 的 路由使用 hash router，而其他web应用使用 BrowserRouter
var createHistory = function (options, type) {
    if (type === void 0) { type = 'browser'; }
    var history;
    switch (type) {
        case 'hash':
        case 'HASH':
            history = createHashHistory(__assign({ basename: '' }, options));
            break;
        case 'memory':
        case 'MEMORY':
            history = createMemoryHistory();
            break;
        default:
            history = createBrowserHistory(options);
    }
    runtime._WEAPPS_HISTORY = history;
    return history;
};
var removeHistory = function () {
    runtime._WEAPPS_HISTORY = undefined;
};
export { createHistory, removeHistory };
//# sourceMappingURL=history.js.map