/**
 * Input parameter of a middleware.
 */
export interface MiddlewareOptions<ArgumentT, ReturnT, ContextT extends MiddlewareContext<ArgumentT>> {
    /**
     * Initial function enriched by the middleware e.g. axios request getting a timeout.
     */
    readonly fn: MiddlewareFunction<ArgumentT, ReturnT>;
    /**
     * Context of the execution e.g. the request context or URL.
     */
    context: ContextT;
}
/**
 * Minimal Context of the middleware.
 */
export interface MiddlewareContext<ArgumentT> {
    /**
     * URI of the function passed to the middleware.
     */
    readonly uri: string;
    /**
     * Tenant identifier.
     */
    readonly tenantId: string | undefined;
}
/**
 * Function around which the middlewares are added.
 */
export type MiddlewareFunction<ArgumentT, ReturnT> = (arg: ArgumentT) => Promise<ReturnT>;
/**
 * Middleware type - This function takes some initial function and returns a function.
 * The input containing the initial function and some context information e.g. axios request and the request context.
 * It returns a new functions with some additional feature e.g. timeout.
 */
export type Middleware<ArgumentT, ReturnT, ContextT extends MiddlewareContext<ArgumentT>> = (options: MiddlewareOptions<ArgumentT, ReturnT, ContextT>) => MiddlewareFunction<ArgumentT, ReturnT>;
/**
 * Helper function to join a list of middlewares given an initial input.
 * @param middlewares - Middlewares to be layered around the function.
 * @param context - Context for the middleware execution.
 * @param fn - Function around which the middlewares are added.
 * @returns Function with middlewares layered around it.
 * @internal
 */
export declare function executeWithMiddleware<ArgumentT, ReturnT, ContextT extends MiddlewareContext<ArgumentT>>(middlewares: Middleware<ArgumentT, ReturnT, ContextT>[] | undefined, { fn, context, fnArgument }: MiddlewareOptions<ArgumentT, ReturnT, ContextT> & {
    fnArgument: ArgumentT;
}): Promise<ReturnT>;
