diff --git a/src/index.js b/src/index.js index b15b634..72638ff 100644 --- a/src/index.js +++ b/src/index.js @@ -206,7 +206,7 @@ export class BrowserHistory extends History { } /** - * Returns the current index in the history object. + * Returns the current index in the navigation history. * @returns The current index. */ getHistoryIndex(): number { @@ -218,6 +218,14 @@ export class BrowserHistory extends History { return historyIndex; } + /** + * Move to a specific position in the navigation history. + * @param movement The amount of steps, positive or negative, to move. + */ + go(movement: number): void { + this.history.go(movement); + } + _getHash(): string { return this.location.hash.substr(1); }