mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-20 03:28:52 +08:00
@@ -144,6 +144,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
|
||||
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
|
||||
* [insight](https://github.com/yeoman/insight) (by [vvakame](https://github.com/vvakame))
|
||||
* [interact.js](http://github.com/taye/interact.js) (by [Douglas Eichelberger](https://github.com/dduugg))
|
||||
* [Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) (by [Douglas Eichelberger](https://github.com/dduugg))
|
||||
* [Ionic-Cordova](https://github.com/driftyco/) (by [Hendrik Maus](https://github.com/hendrikmaus))
|
||||
|
||||
21
insight/insight-tests.ts
Normal file
21
insight/insight-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="./insight.d.ts" />
|
||||
|
||||
declare var require:any;
|
||||
|
||||
import Insight = require('insight');
|
||||
var pkg:any = require('./package.json');
|
||||
|
||||
var insight = new Insight({
|
||||
// Google Analytics tracking code
|
||||
trackingCode: 'UA-XXXXXXXX-X',
|
||||
packageName: pkg.name,
|
||||
packageVersion: pkg.version
|
||||
});
|
||||
|
||||
// ask for permission the first time
|
||||
if (insight.optOut === undefined) {
|
||||
return insight.askPermission();
|
||||
}
|
||||
|
||||
insight.track('foo', 'bar');
|
||||
// recorded in Analytics as `/foo/bar`
|
||||
49
insight/insight.d.ts
vendored
Normal file
49
insight/insight.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// Type definitions for insight 0.4.3
|
||||
// Project: https://github.com/yeoman/insight
|
||||
// Definitions by: vvakame <http://github.com/vvakame>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module insight {
|
||||
interface IOptions {
|
||||
trackingCode:string;
|
||||
trackingProvider?:string;
|
||||
packageName:string;
|
||||
packageVersion?:string;
|
||||
config?:IConfigstore;
|
||||
}
|
||||
|
||||
interface IConfigstore {
|
||||
path:string;
|
||||
all:any;
|
||||
get(key:string):any;
|
||||
set(key:string, val:any):void;
|
||||
del(key:string):void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "insight" {
|
||||
import IOptions = insight.IOptions;
|
||||
import IConfigstore = insight.IConfigstore;
|
||||
|
||||
class Insight {
|
||||
trackingCode:string;
|
||||
trackingProvider:string;
|
||||
packageName:string;
|
||||
packageVersion:string;
|
||||
os:string;
|
||||
nodeVersion:string;
|
||||
appVersion:string;
|
||||
config:IConfigstore;
|
||||
|
||||
optOut:boolean;
|
||||
clientId:string;
|
||||
|
||||
constructor(options:IOptions);
|
||||
|
||||
track(...args:string[]):void;
|
||||
|
||||
askPermission(msg?:string, cb?:Function):void;
|
||||
}
|
||||
|
||||
export = Insight;
|
||||
}
|
||||
Reference in New Issue
Block a user