"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setHistory = setHistory;
exports.getHistory = getHistory;
exports.push = push;
exports.replace = replace;
exports.go = go;
exports.goBack = goBack;
exports.goForward = goForward;
var history = null;
function setHistory(h) {
history = h;
}
function getHistory() {
return history;
}
function push(path, state) {
Iif (history) {
history.push(path, state);
}
}
function replace(path, state) {
Iif (history) {
history.replace(path, state);
}
}
function go(n) {
if (history) {
history.go(n);
}
}
function goBack() {
if (history) {
history.goBack();
}
}
function goForward() {
if (history) {
history.goForward();
}
}
exports.default = {
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward
};
|