node-postgres
node-postgres copied to clipboard
TypeScript: how to import the `NoticeMessage` type?
I'm using the "pg" package in my TypeScript program. I'm using .on('notice', ...) to listen for notices:
client.on('notice', (notice: NoticeMessage) => ...);
What's the right way to import NoticeMessage? It looks like it's not explicitly exported from pg-protocol: pg-protocol/src/index.ts.
This seems to work:
import {NoticeMessage} from 'pg-protocol/dist/messages';
But peeking into the "dist" subfolder feels brittle.
None of the message types are exported from the main index.ts. It would be nice to have these officially exported.