mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-01 11:50:54 +08:00
Added support for Calq
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/// <reference path="calq.d.ts" />
|
||||
function calq_base()
|
||||
{
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1");
|
||||
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1", { your: "config" });
|
||||
|
||||
calq.action.track("Product Review", {"Rating": 9.0});
|
||||
|
||||
calq.action.trackSale("Product Sale", { "Product Id": 149, "Product Name": "Dinosaur T-Shirt XL" }, "USD",10);
|
||||
|
||||
calq.action.trackHTMLLink('Link', { 'Target': 'Calq'});
|
||||
|
||||
calq.action.trackPageView();
|
||||
|
||||
calq.action.trackPageView("Custom Action");
|
||||
|
||||
calq.action.setGlobalProperty("Referral Source", "Google Campaign");
|
||||
}
|
||||
|
||||
function calq_people()
|
||||
{
|
||||
calq.user.identify("1001");
|
||||
|
||||
calq.user.clear();
|
||||
|
||||
calq.user.profile( { "Company": "MegaCorp", "$email": "super_customer1@notarealemail.com" });
|
||||
}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for calq
|
||||
// Project: https://calq.io/docs/client/javascript/reference
|
||||
// Definitions by: Eirik Hoem <https://github.com/eirikhm>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Calq
|
||||
{
|
||||
action:Calq.Action;
|
||||
user:Calq.User;
|
||||
|
||||
init(writeKey:string, options?:{[index:string]:any}):void;
|
||||
}
|
||||
|
||||
declare module Calq
|
||||
{
|
||||
interface Action
|
||||
{
|
||||
track(action:string, params?:{[index:string]:any}):void;
|
||||
trackSale(action:string, params:{[index:string]:any}, currency:string, amount:number):void;
|
||||
trackHTMLLink(action:string, params?:{[index:string]:any}):void;
|
||||
trackPageView(action?:string):void;
|
||||
setGlobalProperty(name:string,value:any):void;
|
||||
}
|
||||
|
||||
interface User
|
||||
{
|
||||
identify(userId:string):void;
|
||||
clear():void;
|
||||
profile(params:{[index:string]:any}):void;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
declare var calq:Calq;
|
||||
Reference in New Issue
Block a user