Type Alias Middleware<TParameters, TReturn>

A middleware in the execution chain.

Can be either a function or an object implementation. Both forms have access to the original arguments, the next middleware function, and the execution context.

Middlewares are executed in order of priority (lower priority first), and each middleware can:

  • Log or monitor function calls
  • Modify arguments before passing to next middleware
  • Cache results
  • Handle errors
  • Modify return values
  • Access and manipulate execution context

Type Parameters

  • TParameters extends unknown[] = unknown[]

    Type of arguments passed to the function

  • TReturn = unknown

    Type of value returned from the function

IMPORT_PATH: @daiso-tech/core/middleware