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.
I'm using the "pg" package in my TypeScript program. I'm using
.on('notice', ...)to listen for notices: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:
But peeking into the "dist" subfolder feels brittle.