Nautical Pirate Moustache

    @types/pg-pool
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.3 • Public • Published

    Installation

    npm install --save @types/pg-pool

    Summary

    This package contains type definitions for pg-pool (https://github.com/brianc/node-pg-pool).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-pool.

    index.d.ts

    // Type definitions for pg-pool 2.0
    // Project: https://github.com/brianc/node-pg-pool
    // Definitions by: Leo Liang <https://github.com/aleung>, Nikita Tokarchuk <https://github.com/mainnika>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.3
    
    import * as pg from 'pg';
    
    declare class Pool<T extends pg.Client> extends pg.Pool {
        readonly Client: Pool.ClientLikeCtr<T>;
    
        constructor(config?: Pool.Config<T>, client?: Pool.ClientLikeCtr<T>);
    
        connect(): Promise<T & pg.PoolClient>;
        connect(callback: (err?: Error, client?: T & pg.PoolClient, done?: (release?: any) => void) => void): void;
    
        on(event: 'error', listener: (err: Error, client: T & pg.PoolClient) => void): this;
        on(event: 'connect' | 'acquire' | 'remove', listener: (client: T & pg.PoolClient) => void): this;
    }
    
    declare namespace Pool {
        type ClientLikeCtr<T extends pg.Client> = new(config?: string | pg.ClientConfig) => T;
    
        interface Config<T extends pg.Client> extends pg.PoolConfig {
            Client?: ClientLikeCtr<T> | undefined;
        }
    }
    
    export = Pool;

    Additional Details

    • Last updated: Thu, 08 Jul 2021 20:19:33 GMT
    • Dependencies: @types/pg
    • Global values: none

    Credits

    These definitions were written by Leo Liang, and Nikita Tokarchuk.

    Keywords

    none

    Install

    npm i @types/pg-pool

    DownloadsWeekly Downloads

    241,474

    Version

    2.0.3

    License

    MIT

    Unpacked Size

    5 kB

    Total Files

    4

    Last publish

    Collaborators

    • types