11declare namespace gapi . analytics {
2- export interface Response { }
2+ export interface Response {
3+ [ x : string ] : any ;
4+ }
35
46 export interface AuthOptions {
57 clientid ?: string ;
@@ -23,35 +25,20 @@ declare namespace gapi.analytics {
2325 static getAuthResponse ( ) : Response ;
2426 static getUserProfile ( ) : Response ;
2527
26- static on (
27- event : "signIn" | "signOut" | "needsAuthorization" ,
28- callback : ( ) => void
29- ) : void ;
30- static on ( event : "error" , callback : ( response : Response ) => void ) : void ;
31- static once (
32- event : "signIn" | "signOut" | "needsAuthorization" ,
33- callback : ( ) => void
34- ) : void ;
35- static once ( event : "error" , callback : ( response : Response ) => void ) : void ;
28+ static on ( event : 'signIn' | 'signOut' | 'needsAuthorization' , callback : ( ) => void ) : void ;
29+ static on ( event : 'error' , callback : ( response : Response ) => void ) : void ;
30+ static once ( event : 'signIn' | 'signOut' | 'needsAuthorization' , callback : ( ) => void ) : void ;
31+ static once ( event : 'error' , callback : ( response : Response ) => void ) : void ;
3632 static off (
37- event : " signIn" | " signOut" | " needsAuthorization" | " error" ,
33+ event : ' signIn' | ' signOut' | ' needsAuthorization' | ' error' ,
3834 handler : Function
3935 ) : void ;
4036
41- on (
42- event : "signIn" | "signOut" | "needsAuthorization" ,
43- callback : ( ) => void
44- ) : void ;
45- on ( event : "error" , callback : ( response : Response ) => void ) : void ;
46- once (
47- event : "signIn" | "signOut" | "needsAuthorization" ,
48- callback : ( ) => void
49- ) : void ;
50- once ( event : "error" , callback : ( response : Response ) => void ) : void ;
51- off (
52- event : "signIn" | "signOut" | "needsAuthorization" | "error" ,
53- handler : Function
54- ) : void ;
37+ on ( event : 'signIn' | 'signOut' | 'needsAuthorization' , callback : ( ) => void ) : void ;
38+ on ( event : 'error' , callback : ( response : Response ) => void ) : void ;
39+ once ( event : 'signIn' | 'signOut' | 'needsAuthorization' , callback : ( ) => void ) : void ;
40+ once ( event : 'error' , callback : ( response : Response ) => void ) : void ;
41+ off ( event : 'signIn' | 'signOut' | 'needsAuthorization' | 'error' , handler : Function ) : void ;
5542 }
5643
5744 export function ready ( callback : ( ) => void ) : void ;
@@ -63,18 +50,39 @@ declare namespace gapi.analytics {
6350 execute ( ) : void ;
6451 }
6552
66- type Query = Record < string , string > ;
53+ export interface Query {
54+ ids : string ;
55+ 'start-date' : string ;
56+ 'end-date' : string ;
57+ metrics : string ;
58+ dimensions ?: string ;
59+ sort ?: string ;
60+ filters ?: string ;
61+ segment ?: string ;
62+ samplingLevel ?: 'DEFAULT' | 'FASTER' | 'HIGHER_PRECISION' ;
63+ 'include-empty-rows' ?: boolean ;
64+ 'start-index' ?: number ;
65+ 'max-results' ?: number ;
66+ output ?: string ;
67+ fields ?: string ;
68+ prettyPrint ?: string ;
69+ userIp ?: string ;
70+ quotaUser ?: string ;
71+ access_token ?: string ;
72+ callback ?: string ;
73+ key ?: string ;
74+ }
6775
6876 export namespace report {
6977 export interface DataOptions {
7078 query : Query ;
7179 }
7280
7381 export class Data extends Component < DataOptions > {
74- on ( event : " success" | " error" , cb : ( res : Response ) => void ) : void ;
75- once ( event : " success" | " error" , cb : ( res : Response ) => void ) : void ;
76- off ( event : " success" | " error" , handler : Function ) : void ;
77- emit ( event : " success" | " error" , res : Response ) : void ;
82+ on ( event : ' success' | ' error' , cb : ( res : Response ) => void ) : void ;
83+ once ( event : ' success' | ' error' , cb : ( res : Response ) => void ) : void ;
84+ off ( event : ' success' | ' error' , handler : Function ) : void ;
85+ emit ( event : ' success' | ' error' , res : Response ) : void ;
7886 }
7987 }
8088
@@ -87,11 +95,11 @@ declare namespace gapi.analytics {
8795 export interface DataChartOptions {
8896 query : Query ;
8997 chart :
90- | ChartOptions < " LINE" , google . visualization . LineChartOptions >
91- | ChartOptions < " COLUMN" , google . visualization . ColumnChartOptions >
92- | ChartOptions < " BAR" , google . visualization . BarChartOptions >
93- | ChartOptions < " TABLE" , google . visualization . TableOptions >
94- | ChartOptions < " GEO" , google . visualization . GeoChartOptions > ;
98+ | ChartOptions < ' LINE' , google . visualization . LineChartOptions >
99+ | ChartOptions < ' COLUMN' , google . visualization . ColumnChartOptions >
100+ | ChartOptions < ' BAR' , google . visualization . BarChartOptions >
101+ | ChartOptions < ' TABLE' , google . visualization . TableOptions >
102+ | ChartOptions < ' GEO' , google . visualization . GeoChartOptions > ;
95103 }
96104
97105 export interface DataChartSuccessResult {
@@ -102,13 +110,13 @@ declare namespace gapi.analytics {
102110 }
103111
104112 export class DataChart extends Component < DataChartOptions > {
105- on ( event : " success" , cb : ( res : DataChartSuccessResult ) => void ) : void ;
106- on ( event : " error" , cb : ( res : Response ) => void ) : void ;
107- once ( event : " success" , cb : ( res : DataChartSuccessResult ) => void ) : void ;
108- once ( event : " error" , cb : ( res : Response ) => void ) : void ;
109- off ( event : " success" | " error" , handler : Function ) : void ;
110- emit ( event : " success" , res : DataChartSuccessResult ) : void ;
111- emit ( event : " error" , res : Response ) : void ;
113+ on ( event : ' success' , cb : ( res : DataChartSuccessResult ) => void ) : void ;
114+ on ( event : ' error' , cb : ( res : Response ) => void ) : void ;
115+ once ( event : ' success' , cb : ( res : DataChartSuccessResult ) => void ) : void ;
116+ once ( event : ' error' , cb : ( res : Response ) => void ) : void ;
117+ off ( event : ' success' | ' error' , handler : Function ) : void ;
118+ emit ( event : ' success' , res : DataChartSuccessResult ) : void ;
119+ emit ( event : ' error' , res : Response ) : void ;
112120 }
113121 }
114122
@@ -118,9 +126,9 @@ declare namespace gapi.analytics {
118126
119127 export class ViewSelector extends Component < ViewSelectorOptions > {
120128 ids : string ;
121- on ( event : " change" , cb : ( ids : string ) => void ) : void ;
122- once ( event : " change" , cb : ( ids : string ) => void ) : void ;
123- off ( event : " change" , handler : Function ) : void ;
124- emit ( event : " change" , ids : string ) : void ;
129+ on ( event : ' change' , cb : ( ids : string ) => void ) : void ;
130+ once ( event : ' change' , cb : ( ids : string ) => void ) : void ;
131+ off ( event : ' change' , handler : Function ) : void ;
132+ emit ( event : ' change' , ids : string ) : void ;
125133 }
126134}
0 commit comments