export interface PostgresClientOptions { host?: string; port?: number; user?: string; password?: string; database?: string; connectionString?: string; max?: number; idleTimeoutMillis?: number; ssl?: boolean | Record; } export type PostgresJobEnumType = 'status' | 'jdata' | 'adata' | 'udata' | 'jmark' | 'hmark' | 'other'; export type PostgresClassType = { new (options: PostgresClientOptions): PostgresClientType; }; export type PostgresPoolType = { new (options: PostgresClientOptions): PostgresPoolClientType; connect: (options: PostgresClientOptions) => Promise; query: (text: string, values?: any[]) => Promise; }; export interface PostgresNotification { channel: string; payload: string; } export interface PostgresClientType { connect: () => Promise; query: (text: string, values?: any[]) => Promise; end: () => Promise; on?: (event: 'notification', listener: (notification: PostgresNotification) => void) => void; off?: (event: 'notification', listener: (notification: PostgresNotification) => void) => void; removeAllListeners?: (event?: string) => void; } export interface PostgresPoolClientType { connect: () => Promise; release: () => void; end: () => Promise; query: (text: string, values?: any[]) => Promise; idleCount: number; totalCount: number; } export interface PostgresQueryResultType { rows: any[]; rowCount: number; } export interface PostgresQueryConfigType { text: string; values?: any[]; } export interface PostgresStreamOptions extends PostgresClientOptions { schema?: string; maxRetries?: number; retryDelay?: number; streamTablePrefix?: string; consumerTablePrefix?: string; } export interface PostgresStreamMessage { id: string; stream: string; message: any; created_at: Date; sequence?: number; } export interface PostgresConsumerGroup { stream: string; group_name: string; last_message_id: string; created_at: Date; updated_at: Date; } export interface PostgresPendingMessage { stream: string; group_name: string; consumer_name: string; message_id: string; delivered_at: Date; delivery_count: number; } export interface PostgresTransaction { client: PostgresPoolClientType; queryBuffer: { text: string; values: any[]; }[]; begin(): Promise; query(text: string, values?: any[]): Promise; commit(): Promise; rollback(): Promise; release(): void; }