// Express type stubs
export interface Request {
  method: string;
  path: string;
  url: string;
  originalUrl: string;
  query: Record<string, any>;
  params: Record<string, any>;
  body: any;
  headers: Record<string, string>;
  user?: any;
  customer?: any;
  livemode?: boolean;
  baseCurrency?: any;
  doc?: any;
  stripeEvent?: any;
  stripeClient?: any;
  get(name: string): string | undefined;
  header(name: string): string | undefined;
  [key: string]: any;
}

export interface Response {
  json(data: any): any;
  status(code: number): Response;
  send(data: any): any;
  redirect(url: string): any;
  set(key: string, value: string): Response;
  setHeader(key: string, value: string): Response;
  cookie(name: string, value: string, options?: any): Response;
  end(): void;
  headersSent: boolean;
  statusCode: number;
  _statusCode?: number;
  _headers?: Record<string, string>;
  _body?: any;
  _sent?: boolean;
}

export type NextFunction = (err?: any) => void;
export type ErrorRequestHandler = (err: any, req: Request, res: Response, next: NextFunction) => void;
