import { BasePipeline } from "./base-pipeline"; import { MiddlewareInterface } from "./interfaces"; /** * Pipeline is an inverted Monoid that stores an array of middleware functions to be applied to data passed as * pipeline.process() argument. * * Unlike Pipeline, SyncPipeline does not resolve Promises returned from previous Middleware function before passing * it to the next one. * * **NOTE**: SyncPipeline creates a shallow copy of the context argument before passing it to the first middleware. */ export declare class SyncPipeline extends BasePipeline { /** * Pointer interface for lifting given middleware functions to a SyncPipeline. * @param middleware - n Middleware functions. */ static of(middleware: MiddlewareInterface): SyncPipeline; /** * Pointer interface for creating a SyncPipeline from array of Middleware. * @param middleware - Array of Middleware functions. */ static from(middleware: MiddlewareInterface[]): SyncPipeline; /** * Pointer interface for creating an empty SyncPipeline. */ static empty(): SyncPipeline; /** * Create new Pipeline containing Middleware functions of both current Pipeline and the Pipeline passed as an * argument. * @param o */ concat(o: SyncPipeline): SyncPipeline; /** * Create a new SyncPipeline with Middleware provided as an argument appended to the end of the Middleware list. * @param middleware */ pipe(middleware: MiddlewareInterface): SyncPipeline; /** * Sequentially call middleware functions stored inside SyncPipeline starting with context provided as an * argument. * * Values returned from middleware functions will be passed to the next middleware as an argument. * * @param ctx */ process(ctx?: TReserved): TResult; }