// Minimal ambient types for node-postgres (pg) — @types/pg is not installed.
// Mirrors @types/pg's permissive defaults (rows: any) so the existing raw-SQL
// route handlers type-check exactly as they would with the real @types/pg.
declare module 'pg' {
  export interface QueryResult<R = any> {
    rows: R[]
    rowCount: number
  }
  export interface PoolConfig {
    connectionString?: string
    ssl?: boolean | { rejectUnauthorized?: boolean }
    max?: number
    [key: string]: unknown
  }
  export class Pool {
    constructor(config?: PoolConfig)
    query<R = any>(text: string, values?: unknown[]): Promise<QueryResult<R>>
    connect(): Promise<PoolClient>
    end(): Promise<void>
  }
  export interface PoolClient {
    query<R = any>(text: string, values?: unknown[]): Promise<QueryResult<R>>
    release(): void
  }
}
