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