In a React web app I have a typescript module from which I'm exporting a series of types, and I want to import some of them into my App.tsx. The module exporting the types looks like this:
// poker_messages.ts
export type Card = { suit: string; rank: string };
//...
export type IncomingPokerMessage = General | PlaceBet | Error;
In App.tsx I can import them like this:
import * as PM from './poker_messages';
Then refer to the types as PM.Card etc. But if I try
import { Card, IncomingPokerMessage } from './poker_messages';
I get an error that the module does not export those names. What's the right way to import only those things I need and without the qualified name?