import { BunRequest } from 'bun'; /** * Utility class for parsing HTTP `Authorization` headers from * {@link Request} or {@link BunRequest} objects. * * Supported authentication schemes: * - **Bearer**: via {@link getBearer()} — returns the token without the "Bearer " prefix. * - **Basic**: via {@link getCredentials()} — decodes Base64 credentials into `{ user, password }`. * * Throws {@link BadRequest} when the header is missing, malformed, or fails validation. */ export declare class AuthorizationParser { private readonly authorization; /** * Creates a new parser instance for the provided request. * * @param req - The HTTP request object. */ constructor(req: Request | BunRequest); /** * Extracts the Bearer token from the `Authorization` header. * * @returns The raw Bearer token string (without the "Bearer " prefix). * @throws {BadRequest} If the header is missing, not using Bearer scheme, or too short. */ getBearer(): string; /** * Extracts Basic Authentication credentials from the `Authorization` header. * * @returns An object containing `{ user, password }`. * @throws {BadRequest} If the header is missing, not using Basic scheme, or malformed. */ getBasicCredentials(): { user: string; password: string; }; }