import type { Request, Response, NextFunction } from "express"; import type { JWTPayload } from "./types.js"; declare module "express" { interface Request { user?: JWTPayload; } } export interface AuthMiddlewareOpts { /** The secret used to verify JWT tokens. */ secret: string; /** If true, returns 401 on missing or invalid token. Defaults to false. */ required?: boolean; } /** * Create Express middleware that extracts and verifies a JWT from the * Authorization: Bearer header. * * If `required` is true, returns 401 on missing or invalid tokens. * If `required` is false (default), continues without auth when no token is present. */ export declare function createAuthMiddleware(opts: AuthMiddlewareOpts): (req: Request, res: Response, next: NextFunction) => void; //# sourceMappingURL=middleware.d.ts.map