/** * A function applicable to the {@link PipeTarget}. * * Pipe functions are functions that, when invoked, returns another function, i.e., {@link PipeBody}, that only accepts 1 parameter, * i.e., {@link PipeTarget}. * * Since TypeScript 4.9, you can use the following idiom to ensure your pipe function is compatible. * * ```ts * function myPipeFunction(arg1: number): PipeBody { * return target => { * // ... * return "result"; * }; * } * * // Ensures type compatibility. * myPipeFunction satisfies PipeFunction; * ``` */ export type PipeFunction = (...args: TArgs) => PipeBody; /** * The return type of {@link PipeFunction}. This is a function that will be eventually invoked * directly with the {@link PipeTarget}. */ export type PipeBody = (target: TTarget) => TReturnValue; export interface PipeTarget { /** * Applies the current object (`this`) to the specified pipe function result. * * @param pipeBody an unary function, usually the return value of {@link PipeFunction}. */ $(pipeBody: PipeBody): T; } //# sourceMappingURL=typing.d.ts.map