import type { AnyAsyncMiddleware, MiddlewareAsync, MiddlewarePromise, OptionsResponse, SpecialNextParam } from './shared.js'; /** * A composite middleware class with priority for asynchronous operations. * @template T - The type of the arguments. * @template TSpecialNextParam - The type of the special next parameter. */ export declare class MiddlewareCompositeWithPriorityAsync implements MiddlewareAsync { readonly name?: string; /** * Creates an instance of MiddlewareCompositeWithPriorityAsync. * @param {string} [name] - The name of the middleware composite. */ constructor(name?: string); private readonly stack; /** * Adds middleware to the stack with a specified priority. * @param {number} priority - The priority of the middleware (the lowest first). * @param {...AnyAsyncMiddleware[]} middlewares - The middlewares to add. * @returns {this} The instance of the middleware composite. */ useMiddleware(priority: number, ...middlewares: AnyAsyncMiddleware[]): this; /** * Adds standard middleware to the stack with a specified priority. * @param {number} priority - The priority of the middleware (the lowest first). * @param {...((...args: T) => Promise)[]} middlewares - The middlewares to add. * @returns {this} The instance of the middleware composite. */ use(priority: number, ...middlewares: ((...args: T) => Promise)[]): this; /** * Adds error middleware to the stack with a specified priority. * @param {number} priority - The priority of the middleware (the lowest first). * @param {...((error: Error | OptionsResponse, ...args: T) => Promise)[]} middlewares - The middlewares to add. * @returns {this} The instance of the middleware composite. */ useError(priority: number, ...middlewares: ((error: Error | OptionsResponse, ...args: T) => Promise)[]): this; /** * Processes the request and returns a promise. * @template X - The type of the return value. * @param {...T} req - The request arguments. * @returns {Promise} A promise that resolves or rejects with the result. */ process(...req: T): Promise; /** * Handles errors in the middleware stack. * @param {Error | OptionsResponse} error - The error to handle. * @param {...T} req - The request arguments. * @returns {MiddlewarePromise} A promise that resolves or rejects with the result. */ handleError(error: Error | OptionsResponse, ...req: T): MiddlewarePromise; /** * Handles the middleware stack. * @param {...T} req - The request arguments. * @returns {MiddlewarePromise} A promise that resolves or rejects with the result. */ handle(...req: T): MiddlewarePromise; }