Handler (cascade) — mw(config, handler) (or mw(handler)) returns the
produced fetch handler, with Base pushed inward from the contextual type
of the call's return. Base is constrained to In & BaseContext for
prerequisite enforcement, and the handler parameter is wrapped in
NoConflict for collision detection — both surface at the call site.
Handler (propagation) — the same call when the wrapped handler declares
prerequisites this layer cannot meet from the inward push alone. Ctx is
read outward off that handler and re-published as this layer's own
requirement, minus the key it contributes.
Config-only — mw(config) (or mw() for config-less) returns an
Entry for use in a pipeline array.
The two directions cannot share one signature: the cascade needs the handler
argument to be a dead inference site, and the propagation needs it to be the
live one. Splitting them into ordered overloads lets each keep what it needs.
The shape of a middleware produced by defineMiddleware.
Three call signatures:
mw(config, handler)(ormw(handler)) returns the produced fetch handler, withBasepushed inward from the contextual type of the call's return.Baseis constrained toIn & BaseContextfor prerequisite enforcement, and the handler parameter is wrapped in NoConflict for collision detection — both surface at the call site.Ctxis read outward off that handler and re-published as this layer's own requirement, minus the key it contributes.mw(config)(ormw()for config-less) returns an Entry for use in a pipeline array.The two directions cannot share one signature: the cascade needs the handler argument to be a dead inference site, and the propagation needs it to be the live one. Splitting them into ordered overloads lets each keep what it needs.