ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / third_party / analytics / externs.js
blob3995860f9ec8c3903ba8598a1d38cf30c4d0de22
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var goog = {};
6 goog.async = {};
8 /**
9 * @interface
10 * @template VALUE
12 goog.async.Deferred;
14 /**
15 * @param {!function(this:T,VALUE):?} cb
16 * @param {T=} opt_scope
17 * @return {!goog.async.Deferred}
18 * @template T
20 goog.async.Deferred.prototype.addCallback;
22 var analytics = {};
24 /** @typedef {string} */
25 analytics.HitType;
27 /** @enum {analytics.HitType} */
28 analytics.HitTypes = {
29 APPVIEW: 'appview',
30 EVENT: 'event',
31 SOCIAL: 'social',
32 TRANSACTION: 'transaction',
33 ITEM: 'item',
34 TIMING: 'timing',
35 EXCEPTION: 'exception'
38 /**
39 * @typedef {{
40 * id: string,
41 * name: string,
42 * valueType: analytics.ValueType,
43 * maxLength: (number|undefined),
44 * defaultValue: (string|undefined)
45 * }}
47 analytics.Parameter;
49 /** @typedef {string|number|boolean} */
50 analytics.Value;
52 /** @typedef {string} */
53 analytics.ValueType;
56 /**
57 * @param {string} appName
58 * @param {string=} opt_appVersion
59 * @return {!analytics.GoogleAnalytics}
61 analytics.getService;
64 /** @interface */
65 analytics.GoogleAnalytics;
67 /**
68 * @param {string} trackingId
69 * @return {!analytics.Tracker}
71 analytics.GoogleAnalytics.prototype.getTracker;
73 /** @return {!goog.async.Deferred.<!analytics.Config>} */
74 analytics.GoogleAnalytics.prototype.getConfig;
77 /** @interface */
78 analytics.Tracker;
80 /** @typedef {function(!analytics.Tracker.Hit)} */
81 analytics.Tracker.Filter;
83 /**
84 * @param {!analytics.HitType|!analytics.EventBuilder} hitType
85 * @param {(!analytics.ParameterMap|
86 * !Object.<string, !analytics.Value>)=} opt_extraParams
87 * @return {!goog.async.Deferred}
89 analytics.Tracker.prototype.send;
91 /**
92 * @param {string} description
93 * @return {!goog.async.Deferred}
95 analytics.Tracker.prototype.sendAppView;
97 /**
98 * @param {string} category
99 * @param {string} action
100 * @param {string=} opt_label
101 * @param {number=} opt_value
102 * @return {!goog.async.Deferred}
104 analytics.Tracker.prototype.sendEvent;
107 * @param {string} network Specifies the social network, for example Facebook
108 * or Google Plus.
109 * @param {string} action Specifies the social interaction action.
110 * For example on Google Plus when a user clicks the +1 button,
111 * the social action is 'plus'.
112 * @param {string} target Specifies the target of a social interaction.
113 * This value is typically a URL but can be any text.
114 * @return {!goog.async.Deferred}
116 analytics.Tracker.prototype.sendSocial;
119 * @param {string=} opt_description Specifies the description of an exception.
120 * @param {boolean=} opt_fatal Was the exception fatal.
121 * @return {!goog.async.Deferred}
123 analytics.Tracker.prototype.sendException;
126 * @param {string} category Specifies the category of the timing.
127 * @param {string} variable Specifies the variable name of the timing.
128 * @param {number} value Specifies the value of the timing.
129 * @param {string=} opt_label Specifies the optional label of the timing.
130 * @param {number=} opt_sampleRate
131 * @return {!goog.async.Deferred}
133 analytics.Tracker.prototype.sendTiming;
135 analytics.Tracker.prototype.forceSessionStart;
138 * @param {string} category
139 * @param {string} variable
140 * @param {string=} opt_label
141 * @param {number=} opt_sampleRate
142 * @return {!analytics.Tracker.Timing}
144 analytics.Tracker.prototype.startTiming;
146 /** @interface */
147 analytics.Tracker.Timing;
149 /** @return {!goog.async.Deferred} */
150 analytics.Tracker.Timing.prototype.send;
152 /** @param {!analytics.Tracker.Filter} filter */
153 analytics.Tracker.prototype.addFilter;
155 /** @interface */
156 analytics.Tracker.Hit;
158 /** @return {!analytics.HitType} */
159 analytics.Tracker.Hit.prototype.getHitType;
161 /** @return {!analytics.ParameterMap} */
162 analytics.Tracker.Hit.prototype.getParameters;
164 analytics.Tracker.Hit.prototype.cancel;
167 /** @interface */
168 analytics.Config = function() {};
170 /** @param {boolean} permitted */
171 analytics.Config.prototype.setTrackingPermitted;
173 /** @return {boolean} */
174 analytics.Config.prototype.isTrackingPermitted;
176 /** @param {number} sampleRate */
177 analytics.Config.prototype.setSampleRate;
180 /** @interface */
181 analytics.ParameterMap;
184 * @typedef {{
185 * key: !analytics.Parameter,
186 * value: !analytics.Value
187 * }}
189 analytics.ParameterMap.Entry;
192 * @param {!analytics.Parameter} param
193 * @param {!analytics.Value} value
195 analytics.ParameterMap.prototype.set;
198 * @param {!analytics.Parameter} param
199 * @return {?analytics.Value}
201 analytics.ParameterMap.prototype.get;
203 /** @param {!analytics.Parameter} param */
204 analytics.ParameterMap.prototype.remove;
206 /** @return {!Object.<string, analytics.Value>} */
207 analytics.ParameterMap.prototype.toObject;
210 /** @interface */
211 analytics.EventBuilder;
213 /** @typedef {{ index: number, value: string }} */
214 analytics.EventBuilder.Dimension;
216 /** @typedef {{ index: number, value: number }} */
217 analytics.EventBuilder.Metric;
219 /** @return {!analytics.EventBuilder} */
220 analytics.EventBuilder.builder;
223 * @param {string} category
224 * @return {!analytics.EventBuilder}
226 analytics.EventBuilder.prototype.category;
229 * @param {string} action
230 * @return {!analytics.EventBuilder}
232 analytics.EventBuilder.prototype.action;
235 * @param {string} label
236 * @return {!analytics.EventBuilder}
238 analytics.EventBuilder.prototype.label;
241 * @param {number} value
242 * @return {!analytics.EventBuilder}
244 analytics.EventBuilder.prototype.value;
247 * @param {!analytics.EventBuilder.Dimension} dimension
248 * @return {!analytics.EventBuilder}
250 analytics.EventBuilder.prototype.dimension;
253 * @param {!analytics.EventBuilder.Metric} metric
254 * @return {!analytics.EventBuilder}
256 analytics.EventBuilder.prototype.metric;
259 * @param {!analytics.Tracker} tracker
260 * @return {!goog.async.Deferred}
262 analytics.EventBuilder.prototype.send;
264 /** @param {!analytics.ParameterMap} parameters */
265 analytics.EventBuilder.prototype.collect;