Coder Social home page Coder Social logo

Export types about penpal HOT 6 CLOSED

aaronius avatar aaronius commented on August 28, 2024 1
Export types

from penpal.

Comments (6)

Aaronius avatar Aaronius commented on August 28, 2024

Hey @olee. Thanks for reporting this. Is this something you'd want to help with or not so much? No pressure either way.

from penpal.

Aaronius avatar Aaronius commented on August 28, 2024

@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.

from penpal.

Aaronius avatar Aaronius commented on August 28, 2024

@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.

from penpal.

olee avatar olee commented on August 28, 2024

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.

from penpal.

Aaronius avatar Aaronius commented on August 28, 2024

Makes sense. Thank you.

from penpal.

Aaronius avatar Aaronius commented on August 28, 2024

This was released in v6. Thanks!

from penpal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.