/** * works like Array.filter but expects a Promise from each element * instead of a synchronous boolean * * Uses Promise.all; if you need an in-flight limit, use filterConcurrent * instead */ export declare function filterAsync(items: ItemType[], callback: (item: ItemType) => boolean | Promise): Promise; /** * works like Array.some but expects a Promise from each element * instead of a synchronous boolean * * Uses Promise.all; if you need an in-flight limit, use someConcurrent * instead */ export declare function someAsync(items: ItemType[], callback: (item: ItemType) => boolean | Promise): Promise; /** * modeled after rescue keyword from Ruby * * Provide a promise - if it successfully resolves the value is passed * through, but if it rejects the error will be caught and the default value * (or undefined) will be returned * * You may optionally provide a condition function to evaluate whether or not * to catch the error, and a logRescue function so that you can log the error * when it's caught. Note that if either of these functions throw your rescue will * also throw instead of returning a value. */ interface RescueOptions { defaultValue?: DefaultType; condition?: (e: Error) => boolean; logRescue?: (e: Error) => void | Promise; } export declare function rescue(promise: Promise): Promise; export declare function rescue(promise: Promise, options: RescueOptions): Promise; export declare function rescue(promise: Promise, defaultValue: DefaultType): Promise; export {};