/** * @brief Return a method which execute a callback based on a boolean. * @typeParam RetType The returned type. * @param {() => Promise} thenFoo The callback of the true branch. * @param {() => Promise} elseFoo The callback of the false branch. * @return (cc: boolean) => Promise The wrapper function. */ declare function ifBoolPromise(thenFoo: () => Promise, elseFoo: () => Promise): (cc: boolean) => Promise; /** * @brief Return a method which execute a callback based on a boolean. * @typeParam InData The input data type. * @typeParam RetType The returned type. * @param {() => Promise} thenFoo The callback of the true branch. * @param {() => Promise} elseFoo The callback of the false branch. * @return (cc: boolean) => Promise The wrapper function. */ declare function ifPromise(condFoo: (inData: InData) => Promise, thenFoo: (inData: InData) => Promise, elseFoo: (inData: InData) => Promise): (inData: InData) => Promise; /** * @brief Return an iterator over an array of data. * @typeParam InType The type fo the input. * @typeParam RetType The returned element type. * @param {(inData: InType) => Promise} foo The callback for each * promise. * @return {(inData: Array) => Promise>} The wrappping * method. */ declare function foreachPromise(foo: (inData: InType) => Promise): (inData: Array) => Promise>; /** * @brief Return a parallel iterator over an array of data. * @typeParam InType The type fo the input. * @typeParam RetType The returned element type. * @param {(inData: InType) => Promise} foo The callback for each * promise. * @return {(inData: Array) => Promise>} The wrappping * method. */ declare function parForeachPromise(foo: (inData: InType) => Promise): (inData: Array) => Promise>; /** * @brief Return a function which always rejects. * @typeParam RetType The promise return type. * @param {string} msg The error message. * @return {() => Promise} The method. */ declare function raisePromiseError(msg: string): () => Promise; /** * @brief Resolve a promise. * Useful to avoid typing issues in case of promises returning non void. * @return {Promise} A resolved promise. */ declare function toVoid(): Promise; /** * @brief Return an loop promise. * @typeParam InType The type of the input. * @typeParam RetType The type of the output. * @param {(inData: InType) => Promise} condition The callback to * evaluate the condition. * @param {(inData) => Promise} body The loop body. * method. * @return {(inData: InType) => Promise>} The loop * implementation. */ declare function whilePromise(condition: (inData: InType) => Promise, body: (inData: InType) => Promise): (inData: InType) => Promise>; export { foreachPromise, ifBoolPromise, ifPromise, parForeachPromise, raisePromiseError, toVoid, whilePromise };