import { HttpException, BadRequestException, UnprocessableEntityException, NotFoundException, ForbiddenException, UnauthorizedException, InternalServerException } from './http.error.js'; import { checkSomePermissionsInList, checkExistPermissionInList } from './utils.js'; import type { Permission } from './utils.js'; export interface KoaContext { state: { user?: { id: string; type: string; }; permissions?: Permission[]; }; request: { headers: Record; path?: string; header: Record; }; headers: Record; body?: unknown; status?: number; params: Record; query: Record; throw(status: number, message: string): never; } export interface RequestOptions { uri: string; headers?: Record; json?: boolean; [key: string]: unknown; } export declare function request(ctx: KoaContext, options: RequestOptions): Promise; export declare function checkPermissionsKoaMiddleware(permissionsToCheck: Permission[]): (ctx: KoaContext, next: () => Promise) => Promise; export interface PermissionWithParams extends Permission { valueParam?: string; valueQueryParam?: string; } export declare function checkPermissionsWithRequestParamsKoaMiddleware(permissions: PermissionWithParams[]): (ctx: KoaContext, next: () => Promise) => Promise; export declare function obtainPermissionsKoaMiddleware(): (ctx: KoaContext, next: () => Promise) => Promise; export declare function obtainUserKoaMiddleware(required?: boolean): (ctx: KoaContext, next: () => Promise) => Promise; export declare function healthKoa(checkFn?: () => Promise): (ctx: KoaContext, next: () => Promise) => Promise; declare const _default: { koa: { request: typeof request; health: typeof healthKoa; obtainUser: typeof obtainUserKoaMiddleware; checkPermissions: typeof checkPermissionsKoaMiddleware; obtainPermissions: typeof obtainPermissionsKoaMiddleware; checkPermissionsWithRequestParams: typeof checkPermissionsWithRequestParamsKoaMiddleware; }; errors: { HttpException: typeof HttpException; BadRequestException: typeof BadRequestException; UnprocessableEntityException: typeof UnprocessableEntityException; NotFoundException: typeof NotFoundException; ForbiddenException: typeof ForbiddenException; UnauthorizedException: typeof UnauthorizedException; InternalServerException: typeof InternalServerException; }; utils: { checkExistPermissionInList: typeof checkExistPermissionInList; checkSomePermissionsInList: typeof checkSomePermissionsInList; }; }; export default _default; //# sourceMappingURL=middleware.d.ts.map