forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DefinitelyTyped#1624 from Bartvds/def/universal-an…
…alytics Created definitions for 'universal-analytics'
- Loading branch information
Showing
3 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/// <reference path="universal-analytics.d.ts" /> | ||
|
||
var ui:UniversalAnalytics; | ||
|
||
var str:string; | ||
var num:number; | ||
var value:any; | ||
var bool:boolean; | ||
var params:Object; | ||
var x:any; | ||
|
||
var client:UniversalAnalytics.Client = ui('UA-123-00'); | ||
client = ui.debug(); | ||
client.send(); | ||
|
||
client = client.pageview(str); | ||
client.pageview(str, (err:any) => {}); | ||
client = client.pageview(params); | ||
client.pageview(params, (err:any) => {}); | ||
client = client.pageview(str, str); | ||
client.pageview(str, str, (err:any) => {}); | ||
client = client.pageview(str, str, str); | ||
client.pageview(str, str, str, (err:any) => {}); | ||
|
||
|
||
client = client.event(str, str); | ||
client.event(str, str, (err:any) => {}); | ||
client = client.event(str, str, str); | ||
client.event(str, str, str, (err:any) => {}); | ||
client = client.event(str, str, str, value); | ||
client.event(str, str, str, value, (err:any) => {}); | ||
client.event(str, str, str, value, params, (err:any) => {}); | ||
client = client.event(params); | ||
client.event(params, (err:any) => {}); | ||
|
||
|
||
client = client.transaction(str); | ||
client.transaction(str, (err:any) => {}); | ||
client = client.transaction(str, num); | ||
client.transaction(str, num, (err:any) => {}); | ||
client = client.transaction(str, num, num); | ||
client.transaction(str, num, num, (err:any) => {}); | ||
client = client.transaction(str, num, num, num); | ||
client.transaction(str, num, num, num, (err:any) => {}); | ||
client = client.transaction(str, num, num, num, str); | ||
client.transaction(str, num, num, num, str, (err:any) => {}); | ||
client = client.transaction(params); | ||
client.transaction(params, (err:any) => {}); | ||
|
||
|
||
client = client.item(num); | ||
client.item(num, (err:any) => {}); | ||
client = client.item(num, num); | ||
client.item(num, num, (err:any) => {}); | ||
client = client.item(num, num, num); | ||
client.item(num, num, num, (err:any) => {}); | ||
client = client.item(num, num, num, str); | ||
client.item(num, num, num, str, (err:any) => {}); | ||
client = client.item(num, num, num, str, str); | ||
client.item(num, num, num, str, str, (err:any) => {}); | ||
client = client.item(num, num, num, str, str, params); | ||
client.item(num, num, num, str, str, params, (err:any) => {}); | ||
client = client.item(params); | ||
client.item(params, (err:any) => {}); | ||
|
||
|
||
client = client.exception(str); | ||
client.exception(str, (err:any) => {}); | ||
client = client.exception(str, bool); | ||
client.exception(str, bool, (err:any) => {}); | ||
client = client.exception(params); | ||
client.exception(params, (err:any) => {}); | ||
|
||
|
||
client = client.timing(str); | ||
client.timing(str, (err:any) => {}); | ||
client = client.timing(str, str); | ||
client.timing(str, str, (err:any) => {}); | ||
client = client.timing(str, str, num); | ||
client.timing(str, str, num, (err:any) => {}); | ||
client = client.timing(str, str, num, str); | ||
client.timing(str, str, num, str, (err:any) => {}); | ||
client = client.timing(params); | ||
client.timing(params, (err:any) => {}); | ||
|
||
|
||
x = client.middleware(str, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Type definitions for universal-analytics v0.3.2 | ||
// Project: https://github.com/peaksandpies/universal-analytics | ||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds> | ||
// Definitions: https://github.com/borisyankov/DefinitelyTyped | ||
|
||
interface UniversalAnalytics { | ||
(accountID:string, uuid?:string, opts?:Object):UniversalAnalytics.Client; | ||
debug():UniversalAnalytics.Client; | ||
} | ||
|
||
declare module UniversalAnalytics { | ||
|
||
interface Client { | ||
|
||
send():void; | ||
|
||
pageview(path:string):Client; | ||
pageview(path:string, callback?:(err:any) => void):void; | ||
pageview(params:Object):Client; | ||
pageview(params:Object, callback?:(err:any) => void):void; | ||
pageview(path:string, hostname:string):Client; | ||
pageview(path:string, hostname:string, callback?:(err:any) => void):void; | ||
pageview(path:string, title:string, hostname:string):Client; | ||
pageview(path:string, title:string, hostname:string, callback?:(err:any) => void):void; | ||
|
||
|
||
event(category:string, action:string):Client; | ||
event(category:string, action:string, callback?:(err:any) => void):void; | ||
event(category:string, action:string, label:string):Client; | ||
event(category:string, action:string, label:string, callback?:(err:any) => void):void; | ||
event(category:string, action:string, label:string, value:any):Client; | ||
event(category:string, action:string, label:string, value:any, callback?:(err:any) => void):void; | ||
event(category:string, action:string, label:string, value:any, params:Object, callback?:(err:any) => void):void; | ||
event(params:Object):Client; | ||
event(params:Object, callback:(err:any) => void):void; | ||
|
||
|
||
transaction(id:string):Client; | ||
transaction(id:string, callback:(err:any) => void):void; | ||
transaction(id:string, revenue:number):Client; | ||
transaction(id:string, revenue:number, callback:(err:any) => void):void; | ||
transaction(id:string, revenue:number, shipping:number):Client; | ||
transaction(id:string, revenue:number, shipping:number, callback:(err:any) => void):void; | ||
transaction(id:string, revenue:number, shipping:number, taxping:number):Client; | ||
transaction(id:string, revenue:number, shipping:number, taxping:number, callback:(err:any) => void):void; | ||
transaction(id:string, revenue:number, shipping:number, taxping:number, affiliation:string):Client; | ||
transaction(id:string, revenue:number, shipping:number, taxping:number, affiliation:string, callback:(err:any) => void):void; | ||
transaction(params:Object):Client; | ||
transaction(params:Object, callback:(err:any) => void):void; | ||
|
||
|
||
item(price:number):Client; | ||
item(price:number, callback:(err:any) => void):void; | ||
item(price:number, quantity:number):Client; | ||
item(price:number, quantity:number, callback:(err:any) => void):void; | ||
item(price:number, quantity:number, sku:number):Client; | ||
item(price:number, quantity:number, sku:number, callback:(err:any) => void):void; | ||
item(price:number, quantity:number, sku:number, name:string):Client; | ||
item(price:number, quantity:number, sku:number, name:string, callback:(err:any) => void):void; | ||
item(price:number, quantity:number, sku:number, name:string, variation:string):Client; | ||
item(price:number, quantity:number, sku:number, name:string, variation:string, callback:(err:any) => void):void; | ||
item(price:number, quantity:number, sku:number, name:string, variation:string, params:Object):Client; | ||
item(price:number, quantity:number, sku:number, name:string, variation:string, params:Object, callback:(err:any) => void):void; | ||
item(params:Object):Client; | ||
item(params:Object, callback:(err:any) => void):void; | ||
|
||
|
||
exception(description:string):Client; | ||
exception(description:string, callback:(err:any) => void):void; | ||
exception(description:string, fatal:boolean):Client; | ||
exception(description:string, fatal:boolean, callback:(err:any) => void):void; | ||
exception(params:Object):Client; | ||
exception(params:Object, callback:(err:any) => void):void; | ||
|
||
|
||
timing(category:string):Client; | ||
timing(category:string, callback:(err:any) => void):void; | ||
timing(category:string, variable:string):Client; | ||
timing(category:string, variable:string, callback:(err:any) => void):void; | ||
timing(category:string, variable:string, time:number):Client; | ||
timing(category:string, variable:string, time:number, callback:(err:any) => void):void; | ||
timing(category:string, variable:string, time:number, label:string):Client; | ||
timing(category:string, variable:string, time:number, label:string, callback:(err:any) => void):void; | ||
timing(params:Object):Client; | ||
timing(params:Object, callback:(err:any) => void):void; | ||
|
||
|
||
middleware(accountID:string, options?:any):any; | ||
} | ||
} | ||
|
||
declare module 'universal-analytics' { | ||
export = UniversalAnalytics; | ||
} |