forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
timelinejs.d.ts
136 lines (128 loc) · 3.45 KB
/
timelinejs.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Type definitions for timelinejs
// Project: https://github.com/NUKnightLab/TimelineJS
// Definitions by: Roland Zwaga <https://github.com/rolandzwaga>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function createStoryJS(config:knightlab.ITimeLineConfiguration):void;
declare module knightlab {
export interface ITimeLineConfiguration {
width: string;
height: string;
/*
* path to json/ or link to googlespreadsheet
* source Should be either the path to the JSON resource to load, or a JavaScript object corresponding to the
* Timeline model.
*
* Here is an example using a data object:
*
* var dataObject = {timeline: {headline: "Headline", type: ... }}
* createStoryJS({
* type: 'timeline',
* width: '800',
* height: '600',
* source: dataObject,
* embed_id: 'my-timeline'
* });
* If source is a string, we will try to automatically recognize resources that are Twitter searches, Google
* Spreadsheets or Storify stories. Failing that, we assume the source is either JSON or JSONP. If string
* matches on .jsonp, we will treat it as JSONP, otherwise, we will append ?callback=onJSONP_Data.
*/
source: any;
type?: string;
/*
* Optional use a different div id for embed
*/
embed_id?: string;
/*
* Optional start at latest date
*/
start_at_end?: boolean;
/*
* Optional start at specific slide
*/
start_at_slide?: string;
/*
* Optional tweak the default zoom level
*/
start_zoom_adjust?: string;
/*
* Optional location bar hashes
*/
hash_bookmark?: boolean;
/*
* Optional font
*/
font?: string;
/*
* Optional debug to console
*/
debug?: boolean;
/*
* Optional language
*/
lang?: string;
/*
* Optional path to css
*/
css?: string;
/*
* Optional path to js
*/
js?: string;
/*
* required in order to use maptype
*/
gmap_key?: string;
/*
* Stamen Maps:
* toner
* toner-lines
* toner-labels
* watercolor
* sterrain
*
* Google Maps:
* ROADMAP
* TERRAIN
* HYBRID
* SATELLITE
*
* OpenStreetMap:
* osm
*/
maptype?: string;
}
export interface ITimelineModel {
timeline:ITimeLine;
}
export interface ITimeLine {
headline?:string;
type?:string;
text?:string;
asset?:ITimeLineAsset;
date?:ITimelineDate[];
era?:ITimelineEra[];
}
export interface ITimeLineAsset {
media:string;
thumbnail?:string;
credit:string;
caption:string;
}
export interface ITimelineDate extends ITimelineEra {
classname?:string;
asset?:ITimeLineAsset;
}
export interface ITimelineEra {
/*
* format example: 2011,12,10
*/
startDate:string;
/*
* format example: 2011,12,10
*/
endDate:string;
headline:string;
text:string;
tag?:string;
}
}