diff --git a/history/history-tests.ts b/history/history-tests.ts index 57ab83f68..5b46307ed 100644 --- a/history/history-tests.ts +++ b/history/history-tests.ts @@ -1,17 +1,19 @@ /// -if (!History.enabled) { - return false; -} +function tests() { + if (!Historyjs.enabled) { + return false; + } -History.Adapter.bind(window, 'statechange', () => { - var State = History.getState(); - History.log(State.data, State.title, State.url); -}); + Historyjs.Adapter.bind(window, 'statechange', () => { + var State = Historyjs.getState(); + Historyjs.log(State.data, State.title, State.url); + }); -History.pushState({ state: 1 }, "State 1", "?state=1"); -History.pushState({ state: 2 }, "State 2", "?state=2"); -History.replaceState({ state: 3 }, "State 3", "?state=3"); -History.pushState(null, null, "?state=4"); -History.back(); -History.go(2); \ No newline at end of file + Historyjs.pushState({ state: 1 }, "State 1", "?state=1"); + Historyjs.pushState({ state: 2 }, "State 2", "?state=2"); + Historyjs.replaceState({ state: 3 }, "State 3", "?state=3"); + Historyjs.pushState(null, null, "?state=4"); + Historyjs.back(); + Historyjs.go(2); +} \ No newline at end of file diff --git a/history/history.d.ts b/history/history.d.ts index 00e4365d9..ecc260a79 100644 --- a/history/history.d.ts +++ b/history/history.d.ts @@ -10,7 +10,7 @@ interface HistoryAdapter { onDomLoad(callback); } -interface History { +interface Historyjs { enabled: bool; pushState(data, title, url); replaceState(data, title, url); @@ -22,4 +22,6 @@ interface History { go(X); log(...messages: any[]); debug(...messages: any[]); -} \ No newline at end of file +} + +declare var Historyjs: Historyjs; \ No newline at end of file