This repository was archived by the owner on Jul 12, 2024. It is now read-only.
Update @woo…/currency
code docs, define & export type declarations.
#7848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
And served the same purpose:
CurrencyConfig
type, exports declarations (afa01e3)So they could be referenced in the other packages.
Accessibility
n/a - its only code documentation change
Screenshots
Detailed test instructions:
npm install @woocommerce/currency
{import('@woocommerce/currency').CurrencyConfig}
Additional notes:
This data type could be used further in
@woocommerce/wc-admin-settings
to make the code docs shorter.Preferable I'd not define
CurrencyProps
type, just door at least
But unfortunately, it's not supported by TypeScript yet Support typedef inheritance with JSDoc microsoft/TypeScript#20077
The type of the object returned by
CurrencyFactory
is still not defined, and the individual methods of that object are lost as well. I'd solve that in a separate PR, as I believe we could do a small refactoring by the way. The current code base makes it hard to document and test it. At least that makes this PR shorter and less controversial.No changelog necessary - added entry in package's one.