The middleware state schema type. Can be a StateDefinitionInit
(including InteropZodObject, StateSchema, or AnnotationRoot) or undefined.
The middleware context schema type. Can be an InteropZodObject,
InteropZodDefault, InteropZodOptional, or undefined.
The full context type available to middleware hooks.
The tools array type registered by the middleware.
Type bag that encapsulates all middleware type parameters.
This interface bundles all the generic type parameters used throughout the middleware system into a single configuration object. This pattern simplifies type signatures and makes it easier to add new type parameters without changing multiple function signatures.
Example