Merge branch 'types-2.0' into patch-2

This commit is contained in:
Nathan Shively-Sanders
2016-11-23 11:02:58 -08:00
505 changed files with 28218 additions and 13184 deletions

3
.gitignore vendored
View File

@@ -37,5 +37,6 @@ node_modules
.sublimets
.settings/launch.json
.vscode
yarn.lock
yarn.lock

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"3d-bin-packing.d.ts",
"index.d.ts",
"3d-bin-packing-tests.ts"
]
}

View File

@@ -1665,7 +1665,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju)
* [:link:](supertest-as-promised/supertest-as-promised.d.ts) [SuperTest as Promised](https://github.com/WhoopInc/supertest-as-promised) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](svg-injector/svg-injector.d.ts) [SVG Injector](https://github.com/iconic/SVGInjector) by [Patrick Westerhoff](https://github.com/poke)
* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact)
* [:link:](svg-pan-zoom/svg-pan-zoom-2.3.9.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact)
* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [César Vidril](https://github.com/Yimiprod)
* [:link:](svg-sprite/svg-sprite.d.ts) [svg-sprite](https://github.com/jkphl/svg-sprite) by [Qubo](https://github.com/tkqubo)
* [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io)
* [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff)

View File

@@ -52,21 +52,26 @@ DefinitelyTyped only works because of contributions by users like you!
Before you share your improvement with the world, use it yourself.
#### Test editing an exiting package
#### Test editing an existing package
To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html).
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`,
or copy them from there and paste inside of `declarations.d.ts` and follow the steps below.
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below.
#### Test a new package
* Add a new file `declarations.d.ts` to your project.
* Add it to the compilation, through `"includes"` or `"files"` in your [tsconfig](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html),
or through a `/// <reference path="" />` declaration in your code.
* Inside `declarations.d.ts`, write `declare module "foo" { }`, then write the module declaration inside.
* Test that your code works.
* *Then*, once you've tested your definitions, make a PR contributing the definition.
Add to your `tsconfig.json`:
```json
"baseUrl": "types",
"typeRoots": ["types"],
```
(You can also use `src/types`.)
Create `types/foo/index.d.ts` containing declarations for the module "foo".
You should now be able import from `"foo"` in your code and it will route to the new type definition.
Then build *and* run the code to make sure your type definition actually corresponds to what happens at runtime.
Once you've tested your definitions with real code, make a PR contributing the definition by copying `types/foo` to `DefinitelyTyped/foo` and adding a `tsconfig.json` and `foo-tests.ts`.
### Make a pull request
@@ -95,7 +100,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR.
#### Create a new package
If you are the library author, or can make a pull request to the library, [bundle](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) types instead of publishing to DefinitelyTyped.
If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped.
If you are adding typings for an NPM package, create a directory with the same name.
If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM.
@@ -187,7 +192,7 @@ Changes to the `master` branch are also manually merged into the `types-2.0` bra
#### I'm writing a definition that depends on another definition. Should I use `<reference types="" />` or an import?
If the module you're referencing is an external module (uses `export`), use an import.
If the module you're referenceing is an ambient module (uses `declare module`, or just declares globals), use `<reference types="" />`.
If the module you're referencing is an ambient module (uses `declare module`, or just declares globals), use `<reference types="" />`.
#### What do I do about older versions of typings?

19
actioncable/tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"actioncable-tests.ts"
]
}

3
amcharts/index.d.ts vendored
View File

@@ -24,6 +24,9 @@ declare namespace AmCharts {
/** Set it to true if you want UTC time to be used instead of local time. */
var useUTC: boolean;
/** Object with themes */
var themes: any;
/** Clears all the charts on page, removes listeners and intervals. */
function clear(): void;

View File

@@ -7,7 +7,35 @@ import * as moment from 'moment';
import * as angular from 'angular';
declare module 'angular' {
export namespace bootstrap.calendar {
export namespace bootstrap.calendar {
interface IEventAction {
/**
* The label of the action
*/
label: string;
/**
* CSS class to be added to the action element
*/
cssClass?: string;
/**
* The action that occurs when it's clicked
* @param args - the IEvent whose action was clicked
*/
onClick: (args: any) => void;
}
interface IEventColor {
/**
* The primary color of the event, should be darker than secondary
*/
primary: string;
/**
* The secondary color of the event, should be lighter than primary
*/
secondary: string;
}
interface IEvent {
/**
* The title of the event
@@ -16,7 +44,7 @@ declare module 'angular' {
/**
* The type of the event (determines its color). Can be important, warning, info, inverse, success or special
*/
type: string;
type?: string;
/**
* A javascript date object for when the event starts
*/
@@ -25,6 +53,14 @@ declare module 'angular' {
* Optional - a javascript date object for when the event ends
*/
endsAt?: Date;
/**
* Color of the Event
*/
color?: IEventColor;
/**
* Actions of the Event
*/
actions?: Array<IEventAction>;
/**
* If edit-event-html is set and this field is explicitly set to false then dont make it editable.
*/
@@ -53,6 +89,10 @@ declare module 'angular' {
* A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc
*/
cssClass?: string;
/**
* If set the event will display as all-day event
*/
allDay?: boolean;
}
interface ICalendarConfig {
@@ -134,7 +174,7 @@ declare module 'angular' {
}
interface IOnViewChangeClick {
(calendarDate: Date, calendarNextView: string): void;
(calendarDate: Date, calendarNextView: string): boolean;
}
}
}

View File

@@ -76,4 +76,4 @@ declare namespace ncy {
**/
getLastStep(): angular.ui.IState;
}
}
}

View File

@@ -76,7 +76,7 @@ declare module 'angular' {
}
interface IColorService {
applyThemeColors(element: Element|JQuery, colorExpression: IColorExpression): void;
applyThemeColors(element: Element | JQuery, colorExpression: IColorExpression): void;
getThemeColor(expression: string): string;
hasTheme(): boolean;
}
@@ -158,7 +158,7 @@ declare module 'angular' {
hideDelay(delay: number): T;
position(position: string): T;
parent(parent?: string | Element | JQuery): T; // default: root node
toastClass(toastClass: string): T;
toastClass(toastClass: string): T;
}
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
@@ -225,7 +225,7 @@ declare module 'angular' {
hues: IThemeHues;
}
interface IBrowserColors{
interface IBrowserColors {
theme: string;
palette: string;
hue: string;
@@ -264,6 +264,7 @@ declare module 'angular' {
definePalette(name: string, palette: IPalette): IThemingProvider;
enableBrowserColor(browserColors: IBrowserColors): Function;
extendPalette(name: string, palette: IPalette): IPalette;
registerStyles(styles: String): void;
setDefaultTheme(theme: string): void;
setNonce(nonce: string): void;
theme(name: string, inheritFrom?: string): ITheme;
@@ -414,7 +415,7 @@ declare module 'angular' {
ESCAPE: string,
};
absPosition: {
TOP: string,
TOP: string,
RIGHT: string,
BOTTOM: string,
LEFT: string,

View File

@@ -1,6 +1,6 @@
{
"files": [
"angular-q-spread.d.ts",
"index.d.ts",
"angular-q-spread-tests.ts"
],
"compilerOptions": {

View File

@@ -162,6 +162,8 @@ declare module 'angular' {
* Really just a regular Array object with $promise and $resolve attached to it
*/
interface IResourceArray<T> extends Array<T & IResource<T>> {
$cancelRequest(): void;
/** the promise of the original server interaction that created this collection. **/
$promise: angular.IPromise<IResourceArray<T>>;
$resolved: boolean;

View File

@@ -110,7 +110,7 @@ declare module 'angular' {
interface IUrlMatcher {
concat(pattern: string): IUrlMatcher;
exec(path: string, searchParams: {}): {};
exec(path: string, search?: any, hash?: string, options?: any): {};
parameters(): string[];
format(values: {}): string;
}

View File

@@ -1,5 +1,3 @@
/// <reference path="angular-websocket.d.ts" />
let dummySocket: ng.websocket.IWebSocket;
let dummyPromise: ng.IPromise<void>;
let dummyScope: ng.IScope;

View File

@@ -1,6 +1,6 @@
{
"files": [
"angular-websocket.d.ts",
"index.d.ts",
"angular-websocket-tests.ts"
],
"compilerOptions": {

View File

@@ -1,9 +1,7 @@
/// <reference path="angular-xeditable.d.ts" />
var myApp = angular.module('testModule', ['xeditable']);
var myApp = angular.module('testModule', ['xeditable']);
myApp.run(["editableOptions", (editableOptions: angular.xeditable.IEditableOptions) => {
editableOptions.activate = "select";
editableOptions.activationEvent = "click";
editableOptions.blurElem = "ignore";

View File

@@ -1,6 +1,6 @@
{
"files": [
"angular-xeditable.d.ts",
"index.d.ts",
"angular-xeditable-tests.ts"
],
"compilerOptions": {

12
assert/index.d.ts vendored
View File

@@ -1,10 +1,15 @@
// Type definitions for assert and power-assert
// Project: https://github.com/Jxck/assert
// Project: https://github.com/twada/power-assert
// Project: https://github.com/Jxck/assert, https://github.com/twada/power-assert
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// copy from assert external module in node.d.ts
// Definitions for commonjs-assert match that of node.js' assert module,
// but commonjs-assert is intended to be used as an independent module,
// for instance when making a stand-alone site or app that doesn't have
// access to node modules. For that reason, these definitions define a
// "assert" module. This will conflict with node.d.ts and other assert
// modules such as "power-assert", but a project should realistically
// only be using one of these at a time.
declare function assert(value:any, message?:string):void;
declare namespace assert {
@@ -51,3 +56,4 @@ declare namespace assert {
export function ifError(value:any):void;
}

View File

@@ -7,22 +7,23 @@ declare var path: {
exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void;
};
function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {}
function callback() { }
async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err, results) { });
async.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array<fs.Stats>) { });
async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array<fs.Stats>) { });
async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err:Error, results:Array<fs.Stats>) { });
async.filter(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.filterSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.filterLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.select(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.selectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.selectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.reject(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.rejectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.rejectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array<string>) { });
async.parallel([
function () { },
@@ -46,9 +47,9 @@ var openFilesObj = {
file2: "fileTwo"
}
var saveFile = function () { }
async.each(openFiles, saveFile, function (err) { });
async.eachSeries(openFiles, saveFile, function (err) { });
var saveFile = function (file:string,cb:(err:Error)=>void) { }
async.each(openFiles, saveFile, function (err:Error) { });
async.eachSeries(openFiles, saveFile, function (err:Error) { });
var documents: any, requestApi: any;
async.eachLimit(documents, 20, requestApi, function (err) { });
@@ -77,9 +78,9 @@ async.foldl(numArray, 0, reducer, function (err, result) { });
async.reduceRight(numArray, 0, reducer, function (err, result) { });
async.foldr(numArray, 0, reducer, function (err, result) { });
async.detect(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.detectSeries(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.detectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err: Error,result:string) { });
async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err,result) { });
async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err,result) { });
async.sortBy(['file1', 'file2', 'file3'], function (file, callback) {
fs.stat(file, function (err, stats) {
@@ -87,13 +88,13 @@ async.sortBy(['file1', 'file2', 'file3'], function (file, callback) {
});
}, function (err, results) { });
async.some(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.someLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.any(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.every(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.everyLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.all(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { });
async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { });
async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { });
@@ -111,7 +112,7 @@ async.series([
],
function (err, results) { });
async.series<string>([
async.series<string,Error>([
function (callback) {
callback(undefined, 'one');
},
@@ -135,7 +136,7 @@ async.series({
},
function (err, results) { });
async.series<number>({
async.series<number,Error>({
one: function (callback) {
setTimeout(function () {
callback(undefined, 1);
@@ -175,7 +176,7 @@ async.parallel([
],
function (err, results) { });
async.parallel<string>([
async.parallel<string,Error>([
function (callback) {
setTimeout(function () {
callback(undefined, 'one');
@@ -204,7 +205,7 @@ async.parallel({
},
function (err, results) { });
async.parallel<number>({
async.parallel<number,Error>({
one: function (callback) {
setTimeout(function () {
callback(undefined, 1);
@@ -270,7 +271,7 @@ async.waterfall([
], function (err, result) { });
var q = async.queue<any>(function (task: any, callback: any) {
var q = async.queue<any,Error>(function (task: any, callback: () => void) {
console.log('hello ' + task.name);
callback();
}, 2);
@@ -323,7 +324,7 @@ q.resume();
q.kill();
// tests for strongly typed tasks
var q2 = async.queue<string>(function (task: string, callback: any) {
var q2 = async.queue<string,Error>(function (task: string, callback: () => void) {
console.log('Task: ' + task);
callback();
}, 1);
@@ -386,10 +387,10 @@ async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }
async.parallel([
function (callback) { },
function (callback: ( err:Error, val:string ) => void ) { },
function (callback) { }
],
function (results) {
function (err:Error,results:Array<string>) {
async.series([
function (callback) { },
function email_link(callback) { }
@@ -442,10 +443,10 @@ async.dir(function (name: string, callback: any) {
// each
async.each<number>({
async.each<number,Error>({
"a": 1,
"b": 2
}, function(val: number, next: ErrorCallback): void {
}, function(val: number, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -461,10 +462,10 @@ async.each<number>({
});
async.eachSeries<number>({
async.eachSeries<number, Error>({
"a": 1,
"b": 2
}, function(val: number, next: ErrorCallback): void {
}, function(val: number, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -480,14 +481,14 @@ async.eachSeries<number>({
});
async.eachLimit<number>({
async.eachLimit<number, Error>({
"a": 1,
"b": 2,
"c": 3,
"d": 4,
"e": 5,
"f": 6
}, 2, function(val: number, next: ErrorCallback): void {
}, 2, function(val: number, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -505,10 +506,10 @@ async.eachLimit<number>({
// forEachOf/eachOf
async.eachOf<number>({
async.eachOf<number, Error>({
"a": 1,
"b": 2
}, function(val: number, key: string, next: ErrorCallback): void {
}, function(val: number, key: string, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -524,10 +525,10 @@ async.eachOf<number>({
});
async.forEachOfSeries<number>({
async.forEachOfSeries<number, Error>({
"a": 1,
"b": 2
}, function(val: number, key: string, next: ErrorCallback): void {
}, function(val: number, key: string, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -543,14 +544,14 @@ async.forEachOfSeries<number>({
});
async.forEachOfLimit<number>({
async.forEachOfLimit<number, Error>({
"a": 1,
"b": 2,
"c": 3,
"d": 4,
"e": 5,
"f": 6
}, 2, function(val: number, key: string, next: ErrorCallback): void {
}, 2, function(val: number, key: string, next: ErrorCallback<Error>): void {
setTimeout(function(): void {
@@ -568,11 +569,11 @@ async.forEachOfLimit<number>({
// map
async.map<number, string>({
async.map<number, string, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, next: AsyncResultCallback<string>): void {
}, function(val: number, next: AsyncResultCallback<string, Error>): void {
setTimeout(function(): void {
@@ -588,11 +589,11 @@ async.map<number, string>({
});
async.mapSeries<number, string>({
async.mapSeries<number, string, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, next: AsyncResultCallback<string>): void {
}, function(val: number, next: AsyncResultCallback<string, Error>): void {
setTimeout(function(): void {
@@ -608,14 +609,14 @@ async.mapSeries<number, string>({
});
async.mapLimit<number, string>({
async.mapLimit<number, string, Error>({
"a": 1,
"b": 2,
"c": 3,
"d": 4,
"e": 5,
"f": 6
}, 2, function(val: number, next: AsyncResultCallback<string>): void {
}, 2, function(val: number, next: AsyncResultCallback<string, Error>): void {
setTimeout(function(): void {
@@ -633,11 +634,11 @@ async.mapLimit<number, string>({
// mapValues
async.mapValues<number, string>({
async.mapValues<number, string, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, key: string, next: AsyncResultCallback<string>): void {
}, function(val: number, key: string, next: AsyncResultCallback<string, Error>): void {
setTimeout(function(): void {
@@ -653,11 +654,11 @@ async.mapValues<number, string>({
});
async.mapValuesSeries<number, string>({
async.mapValuesSeries<number, string, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, key: string, next: AsyncResultCallback<string>): void {
}, function(val: number, key: string, next: AsyncResultCallback<string, Error>): void {
setTimeout(function(): void {
@@ -675,11 +676,11 @@ async.mapValuesSeries<number, string>({
// filter/select/reject
async.filter<number>({
async.filter<number, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, next: AsyncBooleanResultCallback): void {
}, function(val: number, next: AsyncBooleanResultCallback<Error>): void {
setTimeout(function(): void {
@@ -695,11 +696,11 @@ async.filter<number>({
});
async.reject<number>({
async.reject<number, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(val: number, next: AsyncBooleanResultCallback): void {
}, function(val: number, next: AsyncBooleanResultCallback<Error>): void {
setTimeout(function(): void {
@@ -717,11 +718,11 @@ async.reject<number>({
// concat
async.concat<string, string>({
async.concat<string, string, Error>({
"a": "1",
"b": "2",
"c": "3"
}, function(item: string, next: AsyncResultCallback<string[]>): void {
}, function(item: string, next: AsyncResultCallback<string[], Error>): void {
console.log(`async.concat: ${item}`);
@@ -735,11 +736,11 @@ async.concat<string, string>({
// detect/find
async.detect<number>({
async.detect<number, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(item: number, next: AsyncBooleanResultCallback): void {
}, function(item: number, next: AsyncBooleanResultCallback<Error>): void {
console.log(`async.detect/find: ${item}`);
@@ -760,11 +761,11 @@ async.detect<number>({
// every/all
async.every<number>({
async.every<number,Error>({
"a": 1,
"b": 2,
"c": 3
}, function(item: number, next: AsyncBooleanResultCallback): void {
}, function(item: number, next: AsyncBooleanResultCallback<Error>): void {
console.log(`async.every/all: ${item}`);
@@ -778,11 +779,11 @@ async.every<number>({
// some/any
async.some<number>({
async.some<number, Error>({
"a": 1,
"b": 2,
"c": 3
}, function(item: number, next: AsyncBooleanResultCallback): void {
}, function(item: number, next: AsyncBooleanResultCallback<Error>): void {
console.log(`async.some/any: ${item}`);

176
async/index.d.ts vendored
View File

@@ -5,22 +5,22 @@
interface Dictionary<T> { [key: string]: T; }
interface ErrorCallback { (err?: Error): void; }
interface AsyncWaterfallCallback { (err: Error, ...args: any[]): void; }
interface AsyncBooleanResultCallback { (err: Error, truthValue: boolean): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface ErrorCallback<T> { (err?: T): void; }
interface AsyncWaterfallCallback<E> { (err: E, ...args: any[]): void; }
interface AsyncBooleanResultCallback<E> { (err: E, truthValue: boolean): void; }
interface AsyncResultCallback<T, E> { (err: E, result: T): void; }
interface AsyncResultArrayCallback<T, E> { (err: E, results: T[]): void; }
interface AsyncResultObjectCallback<T, E> { (err: E, results: Dictionary<T>): void; }
interface AsyncFunction<T> { (callback: (err?: Error, result?: T) => void): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number|string, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncBooleanIterator<T> { (item: T, callback: AsyncBooleanResultCallback): void; }
interface AsyncFunction<T, E> { (callback: (err?: E, result?: T) => void): void; }
interface AsyncIterator<T, E> { (item: T, callback: ErrorCallback<E>): void; }
interface AsyncForEachOfIterator<T, E> { (item: T, key: number|string, callback: ErrorCallback<E>): void; }
interface AsyncResultIterator<T, R, E> { (item: T, callback: AsyncResultCallback<R, E>): void; }
interface AsyncMemoIterator<T, R, E> { (memo: R, item: T, callback: AsyncResultCallback<R, E>): void; }
interface AsyncBooleanIterator<T, E> { (item: T, callback: AsyncBooleanResultCallback<E>): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncWorker<T, E> { (task: T, callback: ErrorCallback<E>): void; }
interface AsyncVoidFunction<E> { (callback: ErrorCallback<E>): void; }
interface AsyncQueue<T> {
length(): number;
@@ -28,10 +28,10 @@ interface AsyncQueue<T> {
running(): number;
idle(): boolean;
concurrency: number;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
push<E>(task: T, callback?: ErrorCallback<E>): void;
push<E>(task: T[], callback?: ErrorCallback<E>): void;
unshift<E>(task: T, callback?: ErrorCallback<E>): void;
unshift<E>(task: T[], callback?: ErrorCallback<E>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
@@ -53,8 +53,8 @@ interface AsyncPriorityQueue<T> {
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
push<E>(task: T, priority: number, callback?: AsyncResultArrayCallback<T, E>): void;
push<E>(task: T[], priority: number, callback?: AsyncResultArrayCallback<T, E>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
@@ -90,122 +90,122 @@ interface AsyncCargo {
interface Async {
// Collections
each<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
each<T>(arr: Dictionary<T>, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
each<T, E>(arr: T[], iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
each<T, E>(arr: Dictionary<T>, iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
eachSeries: typeof async.each;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachLimit<T, E>(arr: T[], limit: number, iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
eachLimit<T, E>(arr: Dictionary<T>, limit: number, iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
forEach: typeof async.each;
forEachSeries: typeof async.each;
forEachLimit: typeof async.eachLimit;
forEachOf<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOf<T>(obj: Dictionary<T>, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOf<T, E>(obj: T[], iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
forEachOf<T, E>(obj: Dictionary<T>, iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
forEachOfSeries: typeof async.forEachOf;
forEachOfLimit<T>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfLimit<T>(obj: Dictionary<T>, limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfLimit<T, E>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
forEachOfLimit<T, E>(obj: Dictionary<T>, limit: number, iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
eachOf: typeof async.forEachOf;
eachOfSeries: typeof async.forEachOf;
eachOfLimit: typeof async.forEachOfLimit;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
map<T, R>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
map<T, R, E>(arr: T[], iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
map<T, R, E>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
mapSeries: typeof async.map;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
mapLimit<T, R>(arr: Dictionary<T>, limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
mapValuesLimit<T, R>(obj: Dictionary<T>, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback<R>) => void, callback: AsyncResultCallback<R[]>): void;
mapValues<T, R>(obj: Dictionary<T>, iteratee: (value: T, key: string, callback: AsyncResultCallback<R>) => void, callback: AsyncResultCallback<R[]>): void;
mapLimit<T, R, E>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
mapLimit<T, R, E>(arr: Dictionary<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
mapValuesLimit<T, R, E>(obj: Dictionary<T>, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void, callback: AsyncResultCallback<R[], E>): void;
mapValues<T, R, E>(obj: Dictionary<T>, iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void, callback: AsyncResultCallback<R[], E>): void;
mapValuesSeries: typeof async.mapValues;
filter<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
filter<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
filter<T, E>(arr: T[], iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
filter<T, E>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
filterSeries: typeof async.filter;
filterLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
filterLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
filterLimit<T, E>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
filterLimit<T, E>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
select: typeof async.filter;
selectSeries: typeof async.filter;
selectLimit: typeof async.filterLimit;
reject: typeof async.filter;
rejectSeries: typeof async.filter;
rejectLimit: typeof async.filterLimit;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): void;
reduce<T, R, E>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R, E>, callback?: AsyncResultCallback<R, E>): void;
inject: typeof async.reduce;
foldl: typeof async.reduce;
reduceRight: typeof async.reduce;
foldr: typeof async.reduce;
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
detect<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
detect<T, E>(arr: T[], iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
detect<T, E>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
detectSeries: typeof async.detect;
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
detectLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
detectLimit<T, E>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
detectLimit<T, E>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
find: typeof async.detect;
findSeries: typeof async.detect;
findLimit: typeof async.detectLimit;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): void;
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
some<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
sortBy<T, V, E>(arr: T[], iterator: AsyncResultIterator<T, V, E>, callback?: AsyncResultArrayCallback<T, E>): void;
some<T, E>(arr: T[], iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
some<T, E>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
someSeries: typeof async.some;
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
someLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
someLimit<T, E>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
someLimit<T, E>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
any: typeof async.some;
anySeries: typeof async.someSeries;
anyLimit: typeof async.someLimit;
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
every<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
every<T, E>(arr: T[], iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
every<T, E>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
everySeries: typeof async.every;
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
everyLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
everyLimit<T, E>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
everyLimit<T, E>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
all: typeof async.every;
allSeries: typeof async.every;
allLimit: typeof async.everyLimit;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): void;
concat<T, R>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): void;
concat<T, R, E>(arr: T[], iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
concat<T, R, E>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
concatSeries: typeof async.concat;
// Control Flow
series<T>(tasks: AsyncFunction<T>[], callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void;
during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void;
doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void;
forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void;
waterfall<T>(tasks: Function[], callback?: AsyncResultCallback<T>): void;
series<T, E>(tasks: AsyncFunction<T, E>[], callback?: AsyncResultArrayCallback<T, E>): void;
series<T, E>(tasks: Dictionary<AsyncFunction<T, E>>, callback?: AsyncResultObjectCallback<T, E>): void;
parallel<T, E>(tasks: Array<AsyncFunction<T, E>>, callback?: AsyncResultArrayCallback<T, E>): void;
parallel<T, E>(tasks: Dictionary<AsyncFunction<T, E>>, callback?: AsyncResultObjectCallback<T, E>): void;
parallelLimit<T, E>(tasks: Array<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultArrayCallback<T, E>): void;
parallelLimit<T, E>(tasks: Dictionary<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultObjectCallback<T, E>): void;
whilst<E>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
doWhilst<E>(fn: AsyncVoidFunction<E>, test: () => boolean, callback: ErrorCallback<E>): void;
until<E>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
doUntil<E>(fn: AsyncVoidFunction<E>, test: () => boolean, callback: ErrorCallback<E>): void;
during<E>(test: (testCallback : AsyncBooleanResultCallback<E>) => void, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
doDuring<E>(fn: AsyncVoidFunction<E>, test: (testCallback: AsyncBooleanResultCallback<E>) => void, callback: ErrorCallback<E>): void;
forever<E>(next: (next : ErrorCallback<E>) => void, errBack: ErrorCallback<E>) : void;
waterfall<T, E>(tasks: Function[], callback?: AsyncResultCallback<T,E>): void;
compose(...fns: Function[]): Function;
seq(...fns: Function[]): Function;
applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
queue<T>(worker: AsyncWorker<T>, concurrency?: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback<any>): void;
autoInject(tasks: any, callback?: AsyncResultCallback<any>): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: AsyncResultCallback<any>): void;
retry<T>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: AsyncResultCallback<any>): void;
retryable<T>(opts: number | {times: number, interval: number}, task: AsyncFunction<T>): AsyncFunction<T>;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
queue<T, E>(worker: AsyncWorker<T, E>, concurrency?: number): AsyncQueue<T>;
priorityQueue<T, E>(worker: AsyncWorker<T, E>, concurrency: number): AsyncPriorityQueue<T>;
cargo<E>(worker : (tasks: any[], callback : ErrorCallback<E>) => void, payload? : number) : AsyncCargo;
auto<E>(tasks: any, concurrency?: number, callback?: AsyncResultCallback<any, E>): void;
autoInject<E>(tasks: any, callback?: AsyncResultCallback<any, E>): void;
retry<T, E>(opts: number, task: (callback : AsyncResultCallback<T, E>, results: any) => void, callback: AsyncResultCallback<any, E>): void;
retry<T, E>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T, E>, results : any) => void, callback: AsyncResultCallback<any, E>): void;
retryable<T, E>(opts: number | {times: number, interval: number}, task: AsyncFunction<T, E>): AsyncFunction<T, E>;
apply<E>(fn: Function, ...arguments: any[]): AsyncFunction<any,E>;
nextTick(callback: Function, ...args: any[]): void;
setImmediate: typeof async.nextTick;
reflect<T>(fn: AsyncFunction<T>) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void;
reflectAll<T>(tasks: AsyncFunction<T>[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[];
reflect<T, E>(fn: AsyncFunction<T, E>) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void;
reflectAll<T, E>(tasks: AsyncFunction<T, E>[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[];
timeout<T>(fn: AsyncFunction<T>, milliseconds: number, info: any): AsyncFunction<T>;
timeout<T, E>(fn: AsyncFunction<T, E>, milliseconds: number, info: any): AsyncFunction<T, E>;
times<T> (n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesSeries<T>(n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesLimit<T>(n: number, limit: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
times<T, E> (n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
timesSeries<T, E>(n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
timesLimit<T, E>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
transform<T, R>(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
transform<T, R>(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
transform<T, R>(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
transform<T, R>(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
transform<T, R, E>(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void;
transform<T, R, E>(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void;
transform<T, R, E>(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void;
transform<T, R, E>(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void;
race<T>(tasks: (AsyncFunction<T>)[], callback: AsyncResultCallback<T>) : void;
race<T, E>(tasks: (AsyncFunction<T, E>)[], callback: AsyncResultCallback<T, E>) : void;
// Utils
memoize(fn: Function, hasher?: Function): Function;

2
auth0-js/index.d.ts vendored
View File

@@ -84,7 +84,7 @@ interface Auth0Identity {
interface Auth0DecodedHash {
access_token: string;
id_token: string;
idToken: string;
profile: Auth0UserProfile;
state: any;
}

2
aws4/index.d.ts vendored
View File

@@ -30,4 +30,4 @@ export class RequestSigner {
formatPath(): string;
}
export function sign(options?: any, credentials?: any): RequestSigner;
export function sign(options?: any, credentials?: any): any;

View File

@@ -237,7 +237,7 @@ declare namespace Azure.MobileApps {
interface SqlParameterDefinition {
name: string;
value: any;
}
}
interface TableDefinition {
access?: AccessType;

View File

@@ -16,6 +16,7 @@ declare namespace retry {
max_interval?: number;
timeout?: number;
max_tries?: number;
predicate?: any;
}
}

View File

@@ -336,6 +336,29 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{
class CustomError extends Error {
public customField: number;
}
fooProm = fooProm.catch(CustomError, reason => {
let a: number = reason.customField
})
}
{
class CustomErrorWithConstructor extends Error {
constructor(public arg1: boolean, public arg2: number) {
super();
};
}
fooProm = fooProm.catch(CustomErrorWithConstructor, reason => {
let a: boolean = reason.arg1;
let b: number = reason.arg2;
})
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
barProm = fooProm.error((reason: any) => {
return bar;
});

13
bluebird/index.d.ts vendored
View File

@@ -65,14 +65,19 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
*/
catch(predicate: (error: any) => boolean, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
caught(predicate: (error: any) => boolean, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
catch<U>(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
caught<U>(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
catch(ErrorClass: Function, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
caught(ErrorClass: Function, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
catch<U>(ErrorClass: Function, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
caught<U>(ErrorClass: Function, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
catch<E extends Error>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
caught<E extends Error>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
catch<E extends Error, U>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
caught<E extends Error, U>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
catch(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
caught(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
catch<U>(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
caught<U>(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;

View File

@@ -13,6 +13,6 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"bootstrap-fileinput.d.ts"
"index.d.ts"
]
}

View File

@@ -97,7 +97,7 @@ declare namespace BraintreeWeb {
// billingContact
// Billing contact information for the user.
// countryCode
//Required.The merchant<EFBFBD>s two- letter ISO 3166 country code.
//Required.The merchants two- letter ISO 3166 country code.
// currencyCode
// Required.The three- letter ISO 4217 currency code for the payment.
// lineItems
@@ -782,7 +782,7 @@ declare namespace BraintreeWeb {
* });
* @returns {void}
*/
on(event: string, handler: (() => any)): void;
on(event: string, handler: ((event: any) => any)): void;
/**
* Cleanly tear down anything set up by {@link module:braintree-web/hosted-fields.create|create}
@@ -1740,4 +1740,4 @@ interface BraintreeStatic {
VERSION: string;
}
declare var braintree: BraintreeStatic;
declare var braintree: BraintreeStatic;

22
bunyan/index.d.ts vendored
View File

@@ -11,7 +11,7 @@ import { EventEmitter } from 'events';
declare class Logger extends EventEmitter {
constructor(options: LoggerOptions);
addStream(stream: Stream): void;
addSerializers(serializers:Serializers | StdSerializers):void;
addSerializers(serializers:Serializers | StdSerializers):void;
child(options: LoggerOptions, simple?: boolean): Logger;
child(obj: Object, simple?: boolean): Logger;
reopenFileStreams(): void;
@@ -58,18 +58,18 @@ interface LoggerOptions {
src?: boolean;
}
interface Serializer {
(input:any): any;
}
interface Serializer {
(input:any): any;
}
interface Serializers {
[key:string]: Serializer;
}
[key: string]: Serializer
}
interface StdSerializers {
err: Serializer;
res: Serializer;
req: Serializer;
interface StdSerializers {
err: Serializer;
res: Serializer;
req: Serializer;
}
interface Stream {
@@ -82,7 +82,7 @@ interface Stream {
count?: number;
}
export var stdSerializers:StdSerializers;
export declare var stdSerializers: StdSerializers;
export declare var TRACE: number;
export declare var DEBUG: number;

View File

@@ -134,7 +134,7 @@ export namespace types {
var LocalTime: LocalTimeStatic;
var Long: _Long;
var ResultSet: ResultSetStatic;
// var ResultStream: ResultStreamStatic;
// var ResultStream: ResultStreamStatic;
var Row: RowStatic;
var TimeUuid: TimeUuidStatic;
var Tuple: TupleStatic;

View File

@@ -1,5 +1,3 @@
/// <reference path="chai-dom.d.ts" />
import * as chai from 'chai';
import * as chaiDom from 'chai-dom';

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"chai-dom.d.ts",
"index.d.ts",
"chai-dom-tests.ts"
]
}

View File

@@ -1,5 +1,4 @@
/// <reference types="react" />
/// <reference path="./chai-enzyme.d.ts" />
/// <reference types="enzyme" />
/// <reference types="chai" />

View File

@@ -15,7 +15,7 @@
"jsx": "react"
},
"files": [
"chai-enzyme.d.ts",
"index.d.ts",
"chai-enzyme-tests.tsx"
]
}

View File

@@ -0,0 +1,35 @@
import Chai = require('chai');
import ChaiOequal = require('chai-oequal');
Chai.use(ChaiOequal);
import {
expect,
assert
} from 'chai';
expect({
equals: () => true,
}).to.be.oequal({});
expect({
customequals: () => true,
}).to.be.oequal({}, 'customequals');
expect({
equals: () => true,
}).to.be.oeql({});
expect({
equals: () => true,
}).to.be.oeq({});
assert.oequal({
equals: () => true,
}, {});
assert.oequal({
customequals: () => true,
}, {}, 'customequals');
assert.oeql({
equals: () => true,
}, {});
assert.oeq({
equals: () => true,
}, {});

27
chai-oequal/index.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
// Type definitions for chai-oequal
// Project: https://github.com/wrwrwr/chai-oequal
// Definitions by: Mizunashi Mana <https://github.com/mizunashi-mana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="chai" />
declare namespace Chai {
// For BDD APIs
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
oequal(result: any, method?: string): Equal;
oeql(result: any, method?: string): Equal;
oeq(result: any, method?: string): Equal;
}
// For Assert APIs
interface Assert {
oequal(act: any, exp: any, method?: string): Equal;
oeql(act: any, exp: any, method?: string): Equal;
oeq(act: any, exp: any, method?: string): Equal;
}
}
declare module 'chai-oequal' {
function chaiOequal(chai: any, utils: any): void;
export = chaiOequal;
}

19
chai-oequal/tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"chai-oequal-tests.ts"
]
}

6
chai-oequal/tslint.json Normal file
View File

@@ -0,0 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"no-single-declare-module": false
}
}

View File

@@ -0,0 +1,11 @@
/// <reference path="index.d.ts" />
/// <reference types="node" />
let requirePeer = codependency.register(module), package: any;
requirePeer = codependency.register(module, {index: ["dependencies", "devDependencies"]});
requirePeer = codependency.get("some-middleware");
package = requirePeer("some-peer-dependency-package");
package = requirePeer("some-peer-dependency-package", {optional: true});
package = requirePeer("some-peer-dependency-package", {dontThrow: true});
package = requirePeer("some-peer-dependency-package", {optional: true, dontThrow: true});
package = requirePeer.resolve("peer-package-name");

29
codependency/index.d.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
// Type definitions for codependency v0.1.3
// Project: https://github.com/Wizcorp/codependency
// Definitions by: Morgan Benton <https://github.com/morphatic>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export as namespace codependency;
interface DependencyInfo {
supportedRange: string|null;
installedVersion: string|null;
isInstalled: boolean|null;
isValid: boolean|null;
pkgPath: string;
}
interface RequirePeerFunctionOptions {
optional?: boolean;
dontThrow?: boolean;
}
interface RequirePeerFunction {
(name: string, options?: RequirePeerFunctionOptions): any;
resolve: (name: string) => DependencyInfo;
}
export function register(baseModule: NodeModule, options?: {index: string[]}): RequirePeerFunction;
export function get(middlewareName: string): RequirePeerFunction;

View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/node": "^6.0.0"
}
}

View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"codependency-tests.ts"
]
}

View File

@@ -79,6 +79,13 @@ program
console.log('unknown option is allowed');
});
program
.version('0.0.1')
.arguments('<cmd> [env]')
.action(function (cmd, env) {
console.log(cmd, env);
});
program.parse(process.argv);
console.log('stuff');

View File

@@ -74,6 +74,11 @@ declare namespace commander {
*/
command(name:string, desc?:string, opts?: any):ICommand;
/**
* Set / get the arguments usage `str`.
*/
arguments(str: string):ICommand;
/**
* Add an implicit `help [cmd]` subcommand
* which invokes `--help` for the given command.

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"commangular.d.ts",
"index.d.ts",
"commangular-mock.d.ts"
]
}

View File

@@ -74,6 +74,7 @@ declare namespace connectMongo {
* (Default: 10)
*/
autoRemoveInterval?: number;
/**
* don't save session if unmodified
*/

View File

@@ -1,4 +1,3 @@
/// <reference path="./connect-redis.d.ts" />
/// <reference types="express-session" />
import * as connectRedis from "connect-redis";

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"connect-redis.d.ts",
"index.d.ts",
"connect-redis-tests.ts"
]
}

View File

@@ -1,5 +1,3 @@
/// <reference path="csv-parse.d.ts" />
import parse = require('csv-parse');
function callbackAPITest() {
@@ -38,7 +36,7 @@ import fs = require('fs');
function pipeFunctionTest() {
var transform = require('stream-transform');
var output:any = [];
var parser = parse({delimiter: ':'})
var input = fs.createReadStream('/etc/passwd');

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"csv-parse.d.ts",
"index.d.ts",
"csv-parse-tests.ts"
]
}

View File

@@ -1,6 +1,3 @@
/// <reference path="../d3/d3.d.ts" />
/// <reference path="d3-box.d.ts" />
// Inspired by http://bl.ocks.org/mbostock/4061502
function iqr(k: number) {

View File

@@ -3,9 +3,9 @@
// Definitions by: Linkun Chen <https://github.com/lk-chen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts"/>
import * as d3 from "d3";
declare namespace d3 {
declare module "d3" {
export function box(): Box;
interface Box {

5
d3-box/package.json Normal file
View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/d3": "^3.5.36"
}
}

14
d3-box/tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"d3-box-tests.ts"
]
}

View File

@@ -636,6 +636,15 @@ identityTransform = identityTransform.fitSize([960, 500], sampleExtendedFeature2
identityTransform = identityTransform.fitSize([960, 500], sampleFeatureCollection);
identityTransform = identityTransform.fitSize([960, 500], sampleExtendedFeatureCollection);
let reflecting: boolean;
identityTransform = identityTransform.reflectX(true);
// identityTransform = identityTransform.reflectX(5); // fails, wrong argument data type
reflecting = identityTransform.reflectX();
identityTransform = identityTransform.reflectY(true);
// identityTransform = identityTransform.reflectY(5); // fails, wrong argument data type
reflecting = identityTransform.reflectY();
// ----------------------------------------------------------------------
// Stream interface

27
d3-geo/index.d.ts vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for D3JS d3-geo module v1.3.1
// Type definitions for D3JS d3-geo module v1.4.0
// Project: https://github.com/d3/d3-geo/
// Definitions by: Hugues Stefanski <https://github.com/Ledragon>, Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -1412,6 +1412,31 @@ export interface GeoIdentityTranform extends GeoStreamWrapper {
*/
fitSize(size: [number, number], object: ExtendedGeometryCollection<GeoGeometryObjects>): this;
/**
* Returns true if x-reflection is enabled, which defaults to false.
*/
reflectX(): boolean;
/**
* Sets whether or not the x-dimension is reflected (negated) in the output.
*
* @param reflect true = reflect x-dimension, false = do not reflect x-dimension.
*/
reflectX(reflect: boolean): this;
/**
* Returns true if y-reflection is enabled, which defaults to false.
*/
reflectY(): boolean;
/**
* Sets whether or not the y-dimension is reflected (negated) in the output.
*
* This is especially useful for transforming from standard spatial reference systems,
* which treat positive y as pointing up, to display coordinate systems such as Canvas and SVG,
* which treat positive y as pointing down.
*
* @param reflect true = reflect y-dimension, false = do not reflect y-dimension.
*/
reflectY(reflect: boolean): this;
/**
* Returns the current scale factor.

View File

@@ -1,6 +1,3 @@
/// <reference path="../d3/d3.d.ts" />
/// <reference path="d3.slider.d.ts" />
d3.select('#slider1').call(d3.slider());
d3.select('#slider2').call(d3.slider().value( [ 10, 25 ] ));
d3.select('#slider3').call(d3.slider().axis(true).value( [ 10, 25 ] )

View File

@@ -3,9 +3,9 @@
// Definitions by: Linkun Chen <https://github.com/lk-chen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts"/>
import * as d3 from "d3";
declare namespace d3 {
declare module "d3" {
export function slider(): Slider;
interface Slider {

5
d3.slider/package.json Normal file
View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/d3": "^3.5.36"
}
}

14
d3.slider/tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"d3.slider-tests.ts"
]
}

File diff suppressed because it is too large Load Diff

1112
d3kit/d3kit-v1.1.0-tests.ts Normal file

File diff suppressed because it is too large Load Diff

115
d3kit/index.d.ts vendored Normal file
View File

@@ -0,0 +1,115 @@
// Type definitions for d3Kit v3.1.2
// Project: https://github.com/twitter/d3kit
// Definitions by: Morgan Benton <https://github.com/morphatic>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="d3" />
export as namespace d3kit;
export class AbstractChart {
container: Element;
constructor(selector: string|Element, options?: ChartOptions);
static getDefaultOptions(): ChartOptions;
static getCustomEventNames(): string[];
setupDispatcher(customEventNames?: string[]): void;
getCustomEventNames(): string[];
getInnerWidth(): number;
getInnerHeight(): number;
width(value: number): this;
width(): number;
height(value: number): this;
height(): number;
dimension(dimensions: [number, number]): this;
dimension(): [number, number];
data(data: any): this;
data(): any;
margin(margins: ChartMargin): this;
margin(): ChartMargin;
offset(offset: ChartOffset): this;
offset(): ChartOffset;
options(options: ChartOptions): this;
options(): ChartOptions;
updateDimensionNow(): this;
hasData(): boolean;
hasNonZeroArea(): boolean;
fit(fitOptions: FitOptions, watchOptions?: WatchOptions): this;
stopFitWatcher(): this;
on(name: string, listener: () => void): this;
off(name: string): this;
destroy(): void;
}
export interface ChartMargin {
top?: number;
right?: number;
bottom?: number;
left?: number;
}
export interface ChartOffset {
x: number;
y: number;
}
export interface ChartOptions {
initialWidth?: number;
initialHeight?: number;
margin?: ChartMargin;
offset?: ChartOffset;
pixelRatio?: number;
}
// from https://github.com/kristw/slimfit
export interface FitOptions {
mode?: string;
width?: string|number;
height?: string|number;
ratio?: number;
maxWidth?: string|number;
maxHeight?: string|number;
}
// from https://github.com/kristw/slimfit
export interface WatchOptions {
mode?: string;
target?: any; // lazy
interval?: number;
}
export class SvgChart extends AbstractChart {
svg: d3.Selection<d3.BaseType, any, d3.BaseType, any>;
rootG: d3.Selection<d3.BaseType, any, d3.BaseType, any>;
layers: LayerOrganizer;
constructor(selector: string|Element, options?: ChartOptions);
}
export class CanvasChart extends AbstractChart {
constructor(selector: string|Element, options?: ChartOptions);
static getDefaultOptions(): ChartOptions;
getContext2d(): CanvasRenderingContext2D;
clear(): this;
}
export class LayerOrganizer {
constructor(container: d3.Selection<d3.BaseType, any, d3.BaseType, any>, defaultTag?: string);
create(layerNames: string|Array<string>|LayerConfig|Array<LayerConfig>): d3.Selection<d3.BaseType, any, d3.BaseType, any>|Array<d3.Selection<d3.BaseType, any, d3.BaseType, any>>;
get(name: string): d3.Selection<d3.BaseType, any, d3.BaseType, any>;
has(name: string): boolean;
}
export interface LayerConfig {
[layerName: string]: string|string[]|LayerConfig|Array<LayerConfig>;
}
export namespace helper {
function debounce(fn: (...args: Array<any>) => void, delay: number): (...args: Array<any>) => void;
function deepExtend(dest: Object, ...args: Object[]): Object;
function extend(dest: Object, ...args: Object[]): Object;
function functor(value: any): (...args: Array<any>) => any;
function rebind(target: Object, source: Object): Object;
function isFunction(value: any): boolean;
function isObject(value: any): boolean;
function kebabCase(str: string): string;
function throttle(fn: (...args: Array<any>) => void, delay: number): (...args: Array<any>) => void;
}

View File

@@ -1,5 +1,5 @@
{
"dependencies": {
"@types/d3": "^3.5.36"
"@types/d3": "^4.2.38"
}
}

View File

@@ -6,7 +6,6 @@
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"node_modules/@types",
"../"
],
"types": [],
@@ -14,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"d3kit.d.ts",
"index.d.ts",
"d3kit-tests.ts"
]
}

View File

@@ -1,4 +1,3 @@
/// <reference path="daterangepicker.d.ts"/>
import moment = require("moment")
function tests_simple() {

View File

@@ -167,6 +167,5 @@ declare namespace daterangepicker {
}
}
declare module "daterangepicker" {
export = daterangepicker;
}
export = daterangepicker;
export as namespace daterangepicker;

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"daterangepicker.d.ts",
"index.d.ts",
"daterangepicker-tests.ts"
]
}

10
dc/dc-1.6.0.d.ts vendored
View File

@@ -58,7 +58,15 @@ export interface ILegendwidget {
export var events: IEvents;
export interface IListener<T> {
on: (eventName: string, fnctn: (c:T) => void) => T;
on: {
(event: "preRender", fnctn: (c: T) => any): T;
(event: "postRender", fnctn: (c: T) => any): T;
(event: "preRedraw", fnctn: (c: T) => any): T;
(event: "postRedraw", fnctn: (c: T) => any): T;
(event: "filtered", fnctn: (c: T, filter: any) => any): T;
(event: "zoomed", fnctn: (c: T, filter: any) => any): T;
(event: string, fnctn: (c: T, ...args: any[]) => any): T;
};
}
export interface ImarginObj {

11
dc/index.d.ts vendored
View File

@@ -160,7 +160,16 @@ declare namespace DC {
legend: IGetSet<Legend, T>;
options(optionsObject: any): T;
renderlet(fn: (chart: T) => any): T;
on(event: string, fn: (chart: T) => any): T;
on(event: "renderlet", fn: (chart: T, filter: any) => any): T;
on(event: "pretransition", fn: (chart: T, filter: any) => any): T;
on(event: "preRender", fn: (chart: T) => any): T;
on(event: "postRender", fn: (chart: T) => any): T;
on(event: "preRedraw", fn: (chart: T) => any): T;
on(event: "postRedraw", fn: (chart: T) => any): T;
on(event: "filtered", fn: (chart: T, filter: any) => any): T;
on(event: "zoomed", fn: (chart: T, filter: any) => any): T;
on(event: string, fn: (chart: T, ...args: any[]) => any): T;
}
export interface Margins {

View File

@@ -1,5 +1,3 @@
/// <reference path="df-visible.d.ts" />
// https://github.com/customd/jquery-visible/blob/master/examples/demo-basic.html
$(function(){

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"df-visible.d.ts",
"index.d.ts",
"df-visible-tests.ts"
]
}

View File

View File

@@ -15,7 +15,7 @@
"jsx": "react"
},
"files": [
"dva.d.ts",
"index.d.ts",
"dva-tests.tsx"
]
}

View File

@@ -0,0 +1,7 @@
/// <reference path="electron.d.ts" />
/// <reference path="../node/node.d.ts" />
import electron = require('electron');
import child_process = require('child_process');
child_process.spawn(electron);

5765
electron/github-electron.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,3 @@
/// <reference path="epub.d.ts" />
import EPub = require("epub");
var epub = new EPub("./file.epub");

View File

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"epub.d.ts",
"index.d.ts",
"epub-tests.ts"
]
}

View File

@@ -18,7 +18,8 @@ function testConfiguration() {
wildcard: true,
delimiter: '::',
newListener: false,
maxListeners: 20
maxListeners: 20,
verboseMemoryLeak: true
});
var bar = new EventEmitter2({});
var bazz = new EventEmitter2();

View File

@@ -1,4 +1,4 @@
// Type definitions for EventEmitter2 v0.14.4
// Type definitions for EventEmitter2 v2.2.0
// Project: https://github.com/asyncly/EventEmitter2
// Definitions by: ryiwamoto <https://github.com/ryiwamoto/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -23,6 +23,11 @@ interface EventEmitter2Configuration {
* max listeners that can be assigned to an event, default 10.
*/
maxListeners?: number;
/**
* show event name in memory leak message when more than maximum amount of listeners is assigned, default false
*/
verboseMemoryLeak?: boolean;
}
declare class EventEmitter2 {

View File

@@ -1,5 +1,3 @@
/// <reference path="exorcist.d.ts" />
import exorcist = require("exorcist");
module ExorcistTest {

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"exorcist.d.ts",
"index.d.ts",
"exorcist-tests.ts"
]
}

View File

@@ -1,2 +1 @@
/// <reference path="express-domain-middleware.d.ts" />
import fn = require('express-domain-middleware');

View File

@@ -13,7 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"express-domain-middleware.d.ts",
"index.d.ts",
"express-domain-middleware-tests.ts"
]
}

Some files were not shown because too many files have changed in this diff Show More