import { T } from '../types';
/**
 * Attaches a middleware function to a controller method.
 *
 * The middleware will be executed **before the route handler**.
 * If the middleware calls `next(err)`, the error will be forwarded
 * to the framework's error handler. Otherwise, the original
 * controller method will be executed.
 *
 * This decorator also stores middleware metadata using `Reflect.defineMetadata`
 * so the framework can discover and execute it during the request lifecycle.
 *
 * @example
 * ```ts
 * class UserController {
 *
 *   \@Middleware(authMiddleware)
 *   async profile(ctx: T.Context) {
 *     return { user: ctx.user };
 *   }
 *
 * }
 * ```
 *
 * Example middleware:
 *
 * ```ts
 * const authMiddleware: T.ContextHandler = (ctx, next) => {
 *   if (!ctx.user) {
 *     return next(new Error("Unauthorized"));
 *   }
 *   next();
 * };
 * ```
 *
 * @param {T.ContextHandler} middleware - Middleware function to execute before the route handler.
 * @returns {MethodDecorator}
 */
export declare const Middleware: (middleware: T.ContextHandler) => MethodDecorator;
