Closed olee closed 3 years ago
Hey @olee. Thanks for reporting this. Is this something you'd want to help with or not so much? No pressure either way.
@olee, the types are exported and can be found in penpal/lib/types
, so you should be able to import them like so:
import { Connection } from 'penpal/lib/types';
Are you not able to do that or were you expecting something different? Frankly, I'm not terribly familiar with TypeScript conventions for publishing libraries, so if you see Penpal doing something that's not conventional, please let me know so I can correct it.
Thanks for creating the issue.
@lpellegr, maybe this is something you can chime in on as well. I want to make sure we're exporting types in a way that's standard for the TypeScript community so that developers like @olee can more easily find them. If it seems like we're doing it the conventional way, then I probably just need to update documentation to be more clear about how to import the types.
Well, it is possible to import from the child path, however that is not really the recommended behavior, especially since everything else in this library can be imported from the index.
To solve this issue, a simple
export * from './types';
inside index.ts
would solve this and at the same time greatly simplify working with the types in this library.
Makes sense. Thank you.
This was released in v6. Thanks!
Hi, I just wanted to start using this library with typescript, but immediately noticed a big issue: Types like
Connection
do not seem to be exported at all from this library. In fact, the only export seems to beconnectToChild
,connectToParent
andErrorCode
.At least the generic type
Connection
would be highly required to properly type fields