Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS types are not available #34

Open
saravanan7mani opened this issue Dec 14, 2023 · 4 comments
Open

TS types are not available #34

saravanan7mani opened this issue Dec 14, 2023 · 4 comments

Comments

@saravanan7mani
Copy link

TS types ExpansionMap, ParseKeyExpression, Preimage, TimeConstraints are not exported.

https://github.com/saravanan7mani/descriptors/blob/main/src/index.ts#L4

@landabaso
Copy link
Member

Hi @saravanan7mani, thank you for bringing this to my attention.

I've aimed to minimize the number of types exported, with the intention that they should be implicitly set. For instance, in const expansionMap = output.expand().expansionMap, the type is inferred by TypeScript, so an explicit declaration isn't necessary.

However, I'm open to the idea of exposing these types. Could you please clarify the specific circumstances under which you needed each one? For example, I'm curious about your need for TimeConstraints. This is an internal type, and its external usage isn't clear. If we expose it and subsequently change the API, it could result in a breaking change. Understanding your use case will help me make an informed decision.

Looking forward to your response.

@saravanan7mani
Copy link
Author

Hi @landabaso, thank you for the response.

  1. As a function argument types, they are useful. Ex: processExpansionMap(expansionMap: ExpansionMap) and validatePreimage(preimage: Preimage).

  2. Please ignore TimeConstraints and ParseKeyExpression. I just copied them from types.ts without thought.

@landabaso
Copy link
Member

landabaso commented Dec 22, 2023

Are you in need of an immediate fix for this? For now, you might need to manually copy the types. I plan to address this in the next release and will keep the issue open until then. Is this approach workable for you?

@saravanan7mani
Copy link
Author

Yep. Works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants