forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistory.d.ts
31 lines (27 loc) · 898 Bytes
/
history.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Type definitions for History.js
// Project: https://github.com/balupton/History.js
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface HistoryAdapter {
bind(element, event, callback);
trigger(element, event);
onDomLoad(callback);
}
// Since History is defined in lib.d.ts as well
// the name for our interfaces was chosen to be Historyjs
// However at runtime you would need to do
// https://github.com/borisyankov/DefinitelyTyped/issues/277
// var Historyjs: Historyjs = <any>History;
interface Historyjs {
enabled: boolean;
pushState(data, title, url);
replaceState(data, title, url);
getState();
getHash();
Adapter: HistoryAdapter;
back();
forward();
go(X);
log(...messages: any[]);
debug(...messages: any[]);
}