Skip to content

Add Intl.NumberFormat.formatToParts types #25069

@Dangoo

Description

@Dangoo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions