-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Search Terms
- Intl
- Intl.NumberFormat
- Intl.NumberFormat.formatToParts
- formatToParts
(searched wiki, FAQ, issues, and the code)
Suggestion
I'd like to add Intl.NumberFormat.formatToParts method and its return types as stated here at TC39. The proposal is on stage 4 and describes the formatToParts for Intl.NumberFormat and Intl. DateTimeFormat. The last one already got implemented by @donaldpipowitch in #15369, but for Intl.NumberFormats types are still missing.
The code would be pretty close to the DateTimeFormat implementation except for the *FormatPartTypes following ECMA402
Use Cases
For use cases and examples please see TC39/Intl formatToParts.
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)
Are you open for a pull request?
And would you prefer it to extend either
- the existing one for
Intl.DateTimein lib/es2017.intl.d.ts - the base interface of
Intl.NumberFormatin lib/es5.d.ts:4060?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this