{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/25069","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/25069/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/25069/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/25069/events","html_url":"https://github.com/Microsoft/TypeScript/issues/25069","id":333609648,"node_id":"MDU6SXNzdWUzMzM2MDk2NDg=","number":25069,"title":"Add Intl.NumberFormat.formatToParts types","user":{"login":"Dangoo","id":1252204,"node_id":"MDQ6VXNlcjEyNTIyMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1252204?v=4","gravatar_id":"","url":"https://api.github.com/users/Dangoo","html_url":"https://github.com/Dangoo","followers_url":"https://api.github.com/users/Dangoo/followers","following_url":"https://api.github.com/users/Dangoo/following{/other_user}","gists_url":"https://api.github.com/users/Dangoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Dangoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dangoo/subscriptions","organizations_url":"https://api.github.com/users/Dangoo/orgs","repos_url":"https://api.github.com/users/Dangoo/repos","events_url":"https://api.github.com/users/Dangoo/events{/privacy}","received_events_url":"https://api.github.com/users/Dangoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-19T10:22:58Z","updated_at":"2018-06-19T10:22:58Z","closed_at":null,"author_association":"NONE","body":"## Search Terms\r\n\r\n- Intl\r\n- Intl.NumberFormat\r\n- Intl.NumberFormat.formatToParts\r\n- formatToParts\r\n\r\n(searched wiki, FAQ, issues, and the code)\r\n\r\n## Suggestion\r\n\r\nI'd like to add `Intl.NumberFormat.formatToParts` method and its return types as stated here at [TC39](https://github.com/tc39/proposal-intl-formatToParts). 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.\r\nThe code would be pretty close to the `DateTimeFormat` implementation except for the `*FormatPartTypes` following [ECMA402](https://tc39.github.io/ecma402/#sec-partitionnumberpattern)\r\n\r\n## Use Cases\r\n\r\nFor use cases and examples please see [TC39/Intl formatToParts](https://github.com/tc39/proposal-intl-formatToParts).\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n* [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [ ] This could be implemented without emitting different JS based on the types of the expressions\r\n* [ ] This isn't a runtime feature (e.g. new expression-level syntax)\r\n\r\nAre you open for a pull request?\r\nAnd would you prefer it to extend either\r\n- the existing one for `Intl.DateTime` in [lib/es2017.intl.d.ts](https://github.com/Microsoft/TypeScript/blob/master/src/lib/es2017.intl.d.ts)\r\n- the base interface of `Intl.NumberFormat` in [lib/es5.d.ts:4060](https://github.com/Microsoft/TypeScript/blob/master/src/lib/es5.d.ts#L4060)?\r\n\r\n"}}
{"actor":{"display_login":"Dangoo"}}