import { ParsedJwt } from '../auth/jwt';
import type { BaseEntity } from '../database';
import type { EntityClass } from '../database/metadata';
import { HttpRequest } from './request';
import type { RouteParameterResolverContext } from './decorators';
export declare function getJwtFromRequest<T extends object = Record<string, unknown>>(request: HttpRequest): Promise<ParsedJwt<T> | undefined>;
export declare function getSubjectFromRequestJwt(request: HttpRequest): Promise<string | undefined>;
export declare function resolveEntityFromRequestJwt<T extends BaseEntity>(contextOrRequest: RouteParameterResolverContext | HttpRequest, EntityClass: EntityClass<T>): Promise<T | undefined>;
export interface EntityValidator<T extends BaseEntity> {
    getEntityIdFromRequest(request: HttpRequest): Promise<unknown>;
    validateEntity?(request: HttpRequest, entity: T): Promise<void> | void;
}
export declare function createAuthMiddleware<T extends BaseEntity>(EntityClass: EntityClass<T>): {
    new (): {
        handle(request: HttpRequest): Promise<void>;
        getEntityIdFromRequest(request: HttpRequest): Promise<unknown>;
        loadAndValidateEntity(request: HttpRequest, id: unknown): Promise<void>;
    };
};
//# sourceMappingURL=auth.d.ts.map