/**
 * @kosService core.middleware
 */
export type Middleware<D extends object = Record<string, ScalarValue>, R extends object = Record<string, ScalarValue>> = (context: Context<D, R>, next: () => Promise<void>) => Promise<void>;
/**
 * @kosService core.middleware
 * @kosApiLevel 2
 */
export interface Context<D extends object = Record<string, ScalarValue>, R extends object = Record<string, ScalarValue>> {
    data: D;
    result: Partial<R>;
}
type ScalarValue = string | number | boolean | null | undefined;
/**
 * @kosService core.middleware
 * @kosApiLevel 2
 */
export declare class MiddlewareChain<D extends object = Record<string, ScalarValue>, R extends object = Record<string, ScalarValue>, T extends Context<D, R> = Context<D, R>> {
    private middlewares;
    use(middleware: Middleware<D, R>): void;
    execute(context: T): Promise<void>;
}
/**
 * @kosService core.middleware
 * @kosApiLevel 2
 */
export declare const processMiddleware: <D extends object = Record<string, ScalarValue>, R extends object = Record<string, ScalarValue>>(data: D, middleware: Middleware<D, R>[]) => Promise<R>;
export {};
//# sourceMappingURL=middleware.d.ts.map