import { JWTPermissionName, JWTRoleName } from '@becomes/purple-cheetah-mod-jwt/types'; import { ControllerMethodPreRequestHandler, HTTPError, ObjectSchema } from '@becomes/purple-cheetah/types'; import type { UserJwt } from './user'; export interface RouteProtectionJwtConfig { roles?: JWTRoleName[]; permission: JWTPermissionName; instanceRoles?: JWTRoleName[]; admin?: boolean; } export interface RouteProtectionJwtAndBodyConfig extends RouteProtectionJwtConfig { schema: ObjectSchema; } export interface RouteProtectionJwtResult { token: UserJwt; } export interface RouteProtectionBodyCheckResult { body: Body; } export type RouteProtectionJwtAndBodyCheckResult = RouteProtectionJwtResult & RouteProtectionBodyCheckResult; export interface RouteProtectionShimChannelCheckResult { instanceId: string; payload: Payload; } export declare class RouteProtection { static verifyAdminAccess(config: RouteProtectionJwtConfig & { token: string; errorHandler: HTTPError; orgId?: string; instanceId?: string; }): UserJwt; static verifyAccess(config: RouteProtectionJwtConfig & { token: string; errorHandler: HTTPError; orgId?: string; instanceId?: string; }): UserJwt; static createBodyCheck(schema: ObjectSchema): ControllerMethodPreRequestHandler>; static createJwtCheck(config: RouteProtectionJwtConfig): ControllerMethodPreRequestHandler; static createJwtAndBodyCheck(config: RouteProtectionJwtAndBodyConfig): ControllerMethodPreRequestHandler>; static createShimChannelCheck(config: { payloadSchema: ObjectSchema; }): ControllerMethodPreRequestHandler>; }