From 96b5e6eda58cb20f0b058dd2369959e0b8d10abf Mon Sep 17 00:00:00 2001 From: Jedd Ahyoung Date: Thu, 18 Feb 2016 09:36:13 -0500 Subject: [PATCH] feat(history): add getAbsoluteRoot method Per https://github.com/aurelia/router/issues/88 we want to be able to generate an absolute URI with the `router.generate()` method. That method relies upon the history module. `getAbsoluteRoot` allows the router to generate a fully-qualified root URL. --- src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.js b/src/index.js index e104d56..faf70b5 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,13 @@ export class History { throw new Error('History must implement deactivate().'); } + /** + * Returns the fully-qualified root of the current history object. + */ + getAbsoluteRoot(): string { + throw new Error('History must implement getAbsoluteRoot().'); + } + /** * Causes a history navigation to occur. *