— data type flowing through the current chain link
— type of the initial transfer (must be OutputTransfer)
Completes the chain construction and creates a composite transfer.
Links the current transfer to lastTransfer via the link strategy, creates a UniversalCompositeTransfer with input = startTransfer, output = lastTransfer, and returns it typed as CompositeTransfer with flags computed from start and finish transfers.
Options:
— final transfer type (must be InputTransfer)
— sync trigger type
— async trigger type
— gate type
— final input transfer
Optionaloptions: {— completion options
CompositeTransfer with computed flags
Adds an intermediate duplex transfer to the chain.
Links the current transfer to nextTransfer via the link strategy, then returns a new builder with the next transfer's output data type as the current type.
Options:
— type of the next duplex transfer
— duplex transfer to add to the chain
Optionaloptions: { onLinkError?: ErrorHandler<TNextTransfer>; owned?: boolean }
— optional link configuration: owned (destroy nextTransfer on composite destroy),
onLinkError (error handler for async-push rejection, enables async linking)
A new builder with the updated output data type
StaticstartCreates a builder with an initial output transfer.
The start transfer provides the output capabilities that feed data into the chain. If it is also an InputTransfer (duplex), its input flags become the composite's input flags.
Options:
to() and finish() calls.
If omitted, defaults to DefaultLinkStrategy.— type of the initial transfer (must be OutputTransfer)
— initial output transfer
Optionaloptions: { linkStrategy?: LinkStrategyInterface }
— optional start configuration
A new CompositeTransferBuilder instance
Unified builder for constructing composite transfers of any direction (input, output, duplex) with both sync and async transfer support.
Purpose: Creates a composite transfer (
CompositeTransfer) whose capability flags are computed from the start and finish transfers:Pipeline structure: OutputTransfer [→ DuplexTransfer → …] → InputTransfer │ │ │ └─ start() └─ to() └─ finish()
Where:
If the start transfer is also an InputTransfer (i.e. duplex), the composite exposes input capabilities. If the finish transfer is also an OutputTransfer (i.e. duplex), the composite exposes output capabilities. This naturally covers all three cases (input-only, output-only, full-duplex) without separate builder classes.
Sync and async are unified:
onLinkErrorin finish() options enables async error handling when the chain contains async transfers.Linking is performed via a LinkStrategyInterface (defaults to DefaultLinkStrategy when no link strategy is provided). Pass a custom link strategy to
start()to override linking behavior for the entire chain.Example