import type { LazyImport, UnWrapLazyImport } from '@poppinss/utils/types';
import type { MiddlewareAsClass, GetMiddlewareArgs, ParsedGlobalMiddleware } from './types/middleware.ts';
/**
 * Define a collection of named middleware that can be referenced by name in routes and route groups.
 *
 * This function converts a collection of middleware classes into factory functions that can be
 * called with arguments to create middleware references. Each middleware in the collection
 * becomes available as a typed function that preserves the middleware's argument signature.
 *
 * @param collection - Object mapping middleware names to their lazy import references
 *
 * @example
 * ```ts
 * const namedMiddleware = defineNamedMiddleware({
 *   auth: () => import('./middleware/auth.ts'),
 *   throttle: () => import('./middleware/throttle.ts')
 * })
 *
 * // Usage in routes
 * router.get('/dashboard', [namedMiddleware.auth(), handler])
 * router.get('/api/data', [namedMiddleware.throttle({ max: 100 }), handler])
 * ```
 */
export declare function defineNamedMiddleware<NamedMiddleware extends Record<string, LazyImport<MiddlewareAsClass>>>(collection: NamedMiddleware): { [K in keyof NamedMiddleware]: <Args extends GetMiddlewareArgs<UnWrapLazyImport<NamedMiddleware[K]>>>(...args: Args) => {
    name: K;
    reference: LazyImport<MiddlewareAsClass> | MiddlewareAsClass;
    args: Args[0];
    handle: ParsedGlobalMiddleware["handle"];
}; };
