Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion attw.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
"jquery-deferred",
"jsftp",
"jslib-html5-camera-photo",
"json-schema-faker",
"jsoneditor-for-react",
"jsoneditor",
"jsonpath-plus",
Expand Down
16 changes: 16 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@
"libraryName": "codegen.macro",
"asOfVersion": "4.1.0"
},
"colorbrewer": {
"libraryName": "colorbrewer",
"asOfVersion": "1.6.0"
},
"colors": {
"libraryName": "colors",
"asOfVersion": "1.2.1"
Expand Down Expand Up @@ -3449,6 +3453,10 @@
"libraryName": "json-rules-engine",
"asOfVersion": "4.1.0"
},
"json-schema-faker": {
"libraryName": "json-schema-faker",
"asOfVersion": "0.5.6"
},
"json-schema-traverse": {
"libraryName": "json-schema-traverse",
"asOfVersion": "1.0.0"
Expand Down Expand Up @@ -5207,6 +5215,10 @@
"libraryName": "phonegap-plugin-push",
"asOfVersion": "2.1.2"
},
"photoswipe": {
"libraryName": "photoswipe",
"asOfVersion": "5.2.5"
},
"php-serialize": {
"libraryName": "php-serialize",
"asOfVersion": "4.0.0"
Expand Down Expand Up @@ -7887,6 +7899,10 @@
"libraryName": "vue-scrollto",
"asOfVersion": "2.17.1"
},
"vue3-json-viewer": {
"libraryName": "vue3-json-viewer",
"asOfVersion": "2.4.0"
},
"vuedraggable": {
"libraryName": "vuedraggable",
"asOfVersion": "2.24.0"
Expand Down
49 changes: 31 additions & 18 deletions types/async/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,13 @@ export function someLimit<T, E = Error>(
arr: IterableCollection<T>,
limit: number,
iterator: AsyncBooleanIterator<T, E>,
callback?: AsyncBooleanResultCallback<E>,
callback: AsyncBooleanResultCallback<E>,
): void;
export function someLimit<T, E = Error>(
arr: IterableCollection<T>,
limit: number,
iterator: AsyncBooleanIterator<T, E>,
): Promise<boolean>;
export const any: typeof some;
export const anySeries: typeof someSeries;
export const anyLimit: typeof someLimit;
Expand Down Expand Up @@ -576,16 +581,6 @@ export function doUntil<T, R, E = Error>(
test: (/* ...results: T[], */ cb: AsyncBooleanResultCallback) => void,
): Promise<R>;

export function during<E = Error>(
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
fn: AsyncVoidFunction<E>,
callback: ErrorCallback<E>,
): void;
export function doDuring<E = Error>(
fn: AsyncVoidFunction<E>,
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
callback: ErrorCallback<E>,
): void;
export function forever<E = Error>(next: (next: ErrorCallback<E>) => void, errBack: ErrorCallback<E>): void;
export function waterfall<T>(tasks: Function[]): Promise<T>;
export function waterfall<T, E = Error>(tasks: Function[], callback: AsyncResultCallback<T, E>): void;
Expand Down Expand Up @@ -615,7 +610,8 @@ export function auto<R extends Dictionary<any>, E = Error>(
tasks: AsyncAutoTasks<R, E>,
callback: AsyncResultCallback<R, E>,
): void;
export function autoInject<E = Error>(tasks: any, callback?: AsyncResultCallback<any, E>): void;
export function autoInject<E = Error>(tasks: any, callback: AsyncResultCallback<any, E>): void;
export function autoInject(tasks: any): Promise<any>;

export interface RetryOptions<E> {
times?: number | undefined;
Expand Down Expand Up @@ -688,29 +684,46 @@ export function timesLimit<T, E = Error>(
export function transform<T, R, E = Error>(
arr: T[],
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
callback?: AsyncResultArrayCallback<T, E>,
callback: AsyncResultArrayCallback<T, E>,
): void;
export function transform<T, R, E = Error>(
arr: T[],
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
): Promise<Array<T | undefined>>;
export function transform<T, R, E = Error>(
arr: T[],
acc: R[],
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
callback?: AsyncResultArrayCallback<T, E>,
callback: AsyncResultArrayCallback<T, E>,
): void;

export function transform<T, R, E = Error>(
arr: T[],
acc: R[],
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
): Promise<Array<T | undefined>>;
export function transform<T, R, E = Error>(
arr: { [key: string]: T },
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
callback?: AsyncResultObjectCallback<T, E>,
callback: AsyncResultObjectCallback<T, E>,
): void;

export function transform<T, R, E = Error>(
arr: { [key: string]: T },
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
): Promise<Dictionary<T | undefined>>;
export function transform<T, R, E = Error>(
arr: { [key: string]: T },
acc: { [key: string]: R },
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
callback?: AsyncResultObjectCallback<T, E>,
callback: AsyncResultObjectCallback<T, E>,
): void;
export function transform<T, R, E = Error>(
arr: { [key: string]: T },
acc: { [key: string]: R },
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
): Promise<Dictionary<T | undefined>>;

export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback: AsyncResultCallback<T, E>): void;
export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Promise<T>;

export function tryEach<T, E = Error>(
tasks: IterableCollection<AsyncFunction<T>>,
Expand Down
191 changes: 177 additions & 14 deletions types/async/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ promiseIterableString = async.sortBy(["file1", "file2", "file3"], (file, callbac
});

async.some(["file1", "file2", "file3"], funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.some(["file1", "file2", "file3"], funcStringCbErrBoolean);
async.someLimit(["file1", "file2", "file3"], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.someLimit(["file1", "file2", "file3"], 2, funcStringCbErrBoolean);
async.any(["file1", "file2", "file3"], funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.any(["file1", "file2", "file3"], funcStringCbErrBoolean);

async.every(["file1", "file2", "file3"], funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.every(["file1", "file2", "file3"], funcStringCbErrBoolean);
async.everyLimit(["file1", "file2", "file3"], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.everyLimit(["file1", "file2", "file3"], 2, funcStringCbErrBoolean);
async.all(["file1", "file2", "file3"], funcStringCbErrBoolean, (err: Error, result: boolean) => {});
promiseBoolean = async.all(["file1", "file2", "file3"], funcStringCbErrBoolean);

async.concat(["dir1", "dir2", "dir3"], fs.readdir, (err, files) => {}); // $ExpectType void
async.concat<fs.PathLike, string>(["dir1", "dir2", "dir3"], fs.readdir); // $ExpectType Promise<string[]>
Expand Down Expand Up @@ -259,20 +263,6 @@ async.until(whileTest, whileFn, (err: Error) => {});
async.doWhilst(whileFn, whileTest, (err: Error) => {});
async.doUntil(whileFn, whileTest, (err: Error) => {});

async.during(testCallback => {
testCallback(new Error(), false);
}, callback => {
callback();
}, error => {
console.log(error);
});
async.doDuring(callback => {
callback();
}, testCallback => {
testCallback(new Error(), false);
}, error => {
console.log(error);
});
async.forever(errBack => {
errBack(new Error("Not going on forever."));
}, error => {
Expand Down Expand Up @@ -1039,3 +1029,176 @@ const wrapped3 = async.timeout(myFunction3, 1000, { bar: "bar" });
wrapped3((err: Error, data: any) => {
console.log(`async.timeout 3 end ${data}`);
});

declare let autoInjectsTask: any;
// $ExpectType void
async.autoInject(autoInjectsTask, (error, result) => {
// $ExpectType Error | null | undefined
error;
// $ExpectType any
result;
});
// $ExpectType Promise<any>
async.autoInject(autoInjectsTask);

// $ExpectType void
async.transform<string, number>(
[] as string[],
(acc, item, key, callback) => {
// $ExpectType number[]
acc;
// $ExpectType string
item;
// $ExpectType number
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
(error, result) => {
// $ExpectType Error | null | undefined
error;
// $ExpectType (string | undefined)[] | undefined
result;
},
);
// $ExpectType Promise<(string | undefined)[]>
async.transform<string, number>(
[] as string[],
(acc, item, key, callback) => {
// $ExpectType number[]
acc;
// $ExpectType string
item;
// $ExpectType number
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
);
// $ExpectType void
async.transform<string, number>(
[] as string[],
[] as number[],
(acc, item, key, callback) => {
// $ExpectType number[]
acc;
// $ExpectType string
item;
// $ExpectType number
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
(error, result) => {
// $ExpectType Error | null | undefined
error;
// $ExpectType (string | undefined)[] | undefined
result;
},
);
// $ExpectType Promise<(string | undefined)[]>
async.transform<string, number>(
[] as string[],
[] as number[],
(acc, item, key, callback) => {
// $ExpectType number[]
acc;
// $ExpectType string
item;
// $ExpectType number
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
);
// $ExpectType void
async.transform<string, number>(
{ key: "value" },
(acc, item, key, callback) => {
// $ExpectType { [key: string]: number }
acc;
// $ExpectType string
item;
// $ExpectType string
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
(error, result) => {
// $ExpectType Error | undefined
error;
// $ExpectType Dictionary<string | undefined>
result;
},
);
// $ExpectType Promise<Dictionary<string | undefined>>
async.transform<string, number>(
{ key: "value" },
(acc, item, key, callback) => {
// $ExpectType { [key: string]: number }
acc;
// $ExpectType string
item;
// $ExpectType string
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
);
// $ExpectType void
async.transform<string, number>(
{ key: "value" },
{ key: 1 },
(acc, item, key, callback) => {
// $ExpectType { [key: string]: number }
acc;
// $ExpectType string
item;
// $ExpectType string
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
(error, result) => {
// $ExpectType Error | undefined
error;
// $ExpectType Dictionary<string | undefined>
result;
},
);
// $ExpectType Promise<Dictionary<string | undefined>>
async.transform<string, number>(
{ key: "value" },
{ key: 1 },
(acc, item, key, callback) => {
// $ExpectType { [key: string]: number }
acc;
// $ExpectType string
item;
// $ExpectType string
key;
// $ExpectType (error?: Error | undefined) => void
callback;
},
);

// $ExpectType void
async.race<string>(
[(taskCallback) => {
// $ExpectType (err?: Error | null | undefined, result?: string | undefined) => void
taskCallback;
}],
(error, result) => {
// $ExpectType Error | null | undefined
error;
// $ExpectType string | undefined
result;
},
);
// $ExpectType Promise<string>
async.race<string>(
[(taskCallback) => {
// $ExpectType (err?: Error | null | undefined, result?: string | undefined) => void
taskCallback;
}],
);
6 changes: 0 additions & 6 deletions types/colorbrewer/.eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions types/colorbrewer/.npmignore

This file was deleted.

6 changes: 0 additions & 6 deletions types/colorbrewer/colorbrewer-tests.ts

This file was deleted.

Loading