Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
declare namespace pPipe {
type UnaryFunction = (
value: ValueType
) => ReturnType | PromiseLike;
type Pipeline = (
value?: ValueType
) => Promise;
}
/**
Compose promise-returning & async functions into a reusable pipeline.
@param ...input - Iterated over sequentially when returned `function` is called.
@returns The `input` functions are applied from left to right.
@example
```
import pPipe = require('p-pipe');
const addUnicorn = async string => `${string} Unicorn`;
const addRainbow = async string => `${string} Rainbow`;
const pipeline = pPipe(addUnicorn, addRainbow);
(async () => {
console.log(await pipeline('❤️'));
//=> '❤️ Unicorn Rainbow'
})();
```
*/
declare function pPipe(
f1: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ResultValue4,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction,
f5: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ResultValue4,
ResultValue5,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction,
f5: pPipe.UnaryFunction,
f6: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ResultValue4,
ResultValue5,
ResultValue6,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction,
f5: pPipe.UnaryFunction,
f6: pPipe.UnaryFunction,
f7: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ResultValue4,
ResultValue5,
ResultValue6,
ResultValue7,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction,
f5: pPipe.UnaryFunction,
f6: pPipe.UnaryFunction,
f7: pPipe.UnaryFunction,
f8: pPipe.UnaryFunction
): pPipe.Pipeline;
declare function pPipe<
ValueType,
ResultValue1,
ResultValue2,
ResultValue3,
ResultValue4,
ResultValue5,
ResultValue6,
ResultValue7,
ResultValue8,
ReturnType
>(
f1: pPipe.UnaryFunction,
f2: pPipe.UnaryFunction,
f3: pPipe.UnaryFunction,
f4: pPipe.UnaryFunction,
f5: pPipe.UnaryFunction,
f6: pPipe.UnaryFunction,
f7: pPipe.UnaryFunction,
f8: pPipe.UnaryFunction,
f9: pPipe.UnaryFunction
): pPipe.Pipeline;
// Fallbacks if more than 9 functions are passed as input (not type-safe).
declare function pPipe(
...functions: (pPipe.UnaryFunction)[]
): pPipe.Pipeline;
export = pPipe;