Open saravanan7mani opened 7 months ago
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.
Hi @landabaso, thank you for the response.
As a function argument types, they are useful. Ex: processExpansionMap(expansionMap: ExpansionMap)
and validatePreimage(preimage: Preimage)
.
Please ignore TimeConstraints
and ParseKeyExpression
. I just copied them from types.ts
without thought.
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?
Yep. Works for me.
TS types ExpansionMap, ParseKeyExpression, Preimage, TimeConstraints are not exported.
https://github.com/saravanan7mani/descriptors/blob/main/src/index.ts#L4