From b478d10f85c4a38a44516fc98f04dc7783f74794 Mon Sep 17 00:00:00 2001 From: Kai Groner Date: Tue, 2 Mar 2021 08:38:08 -0500 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=A4=96=20Merge=20PR=20#51183=20?= =?UTF-8?q?Use=20NoticeMessage=20type=20for=20pg.Client=20'notice'=20event?= =?UTF-8?q?.=20by=20@groner"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 630502c2aa37a172ef598fbc462f29a01034e6c9. --- types/pg/index.d.ts | 4 +--- types/pg/package.json | 3 +-- types/pg/pg-tests.ts | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 36d0b30762464d..7886828e2a0621 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -9,7 +9,6 @@ import events = require('events'); import stream = require('stream'); import pgTypes = require('pg-types'); -import { NoticeMessage } from 'pg-protocol/dist/messages'; import { ConnectionOptions } from 'tls'; @@ -249,8 +248,7 @@ export class ClientBase extends events.EventEmitter { escapeLiteral(str: string): string; on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'notice', listener: (notice: NoticeMessage) => void): this; + on(event: 'error' | 'notice', listener: (err: Error) => void): this; on(event: 'notification', listener: (message: Notification) => void): this; // tslint:disable-next-line unified-signatures on(event: 'end', listener: () => void): this; diff --git a/types/pg/package.json b/types/pg/package.json index 58a04a01098227..f43d01c8b55702 100644 --- a/types/pg/package.json +++ b/types/pg/package.json @@ -1,7 +1,6 @@ { "private": true, "dependencies": { - "pg-types": "^2.2.0", - "pg-protocol": "^1.2.0" + "pg-types": "^2.2.0" } } diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index e9ecbbad053958..a20777d0395ee4 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -1,6 +1,5 @@ import { types, Client, CustomTypesConfig, QueryArrayConfig, Pool } from 'pg'; import TypeOverrides = require('pg/lib/type-overrides'); -import { NoticeMessage } from 'pg-protocol/dist/messages'; // https://github.com/brianc/node-pg-types // tslint:disable-next-line no-unnecessary-callback-wrapper @@ -22,7 +21,6 @@ const host: string = client.host; const password: string | undefined = client.password; const ssl: boolean = client.ssl; -client.on('notice', (notice: NoticeMessage) => console.warn(`${notice.severity}: ${notice.message}`)); client.connect(err => { if (err) { console.error('Could not connect to postgres', err);