Home > @idealeap/pipeline > Pipeline
Pipeline class
Represents a pipeline that consists of multiple pipes, offering methods to execute them sequentially, add or remove pipes, and serialize the pipeline configuration.
Signature:
typescript
export declare class Pipelineexport declare class PipelineConstructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(pipes, options) | Constructs a new Pipeline instance. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| addPipe(pipe) | Adds one or more pipes to the pipeline. | |
| create(options) | static | Constructs a new empty Pipeline instance, supporting chainable method calls. |
| execute(input) | Executes the pipeline using the provided input. | |
| fromJSON(json, fnMap, predefinedUses) | static | Constructs a new Pipeline instance from a serializable configuration and a mapping of functions. |
| removePipe(id) | Removes a pipe from the pipeline based on its ID. | |
| setOnProgress(callback) | Sets a callback to track the pipeline's execution progress. | |
| toJSON() | Serializes the pipeline's configuration to a JSON-friendly format. |