Skip to content

typescript support #7

@cesco69

Description

@cesco69
declare module 'postgres-bridge' {
    import { PoolConfig, Pool } from 'pg'; // Importing specific types from pg
    import postgres from 'postgres'; // Importing the default export from postgres module

    export class PostgresBridge {
        constructor(configuration: PoolConfig);
        /** Connect to the database */
        connect(): Promise<Pool>;
    }

    // Type alias for the default import of postgres module
    type PostgresLib = typeof postgres;

    /** 
     * Factory function to create a PostgresBridge instance 
     * @param postgres - the postgres library instance
     */
    export function createPostgresBridge(postgres: PostgresLib): typeof PostgresBridge;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions