mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[pg]: Add a "Notification" type and pass it to the notification event listener
See: https://node-postgres.com/api/client#client-on-39-notification-39-notification-notification-gt-void-gt-void
This commit is contained in:
parent
5bb93e3433
commit
e84cf3ef7b
8
types/pg/index.d.ts
vendored
8
types/pg/index.d.ts
vendored
@ -60,6 +60,12 @@ export interface QueryResult {
|
||||
rows: any[];
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
processId: number,
|
||||
channel: string,
|
||||
payload?: string
|
||||
}
|
||||
|
||||
export interface ResultBuilder extends QueryResult {
|
||||
addRow(row: any): void;
|
||||
}
|
||||
@ -109,7 +115,7 @@ export declare class Client extends events.EventEmitter {
|
||||
|
||||
on(event: "drain", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "notification" | "notice", listener: (message: any) => void): this;
|
||||
on(event: "notification" | "notice", listener: (message: Notification) => void): this;
|
||||
on(event: "end", listener: () => void): this;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user