History.js definitions and tests added

This commit is contained in:
Boris Yankov
2012-10-13 19:43:39 +03:00
parent 716a5a0c49
commit 9f07758e11
2 changed files with 42 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for History.js
// Project: https://github.com/balupton/History.js
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface HistoryAdapter {
bind(element, event, callback);
trigger(element, event);
onDomLoad(callback);
}
interface HistoryStatic {
enabled: bool;
pushState(data, title, url);
replaceState(data, title, url);
getState();
getHash();
Adapter: HistoryAdapter;
back();
forward();
go(X);
log(...messages: any[]);
debug(...messages: any[]);
}
declare var History: HistoryStatic;