{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/27336","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/27336/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/27336/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/27336/events","html_url":"https://github.com/Microsoft/TypeScript/issues/27336","id":363506741,"node_id":"MDU6SXNzdWUzNjM1MDY3NDE=","number":27336,"title":"I was hoping if it was possible to infer optional props from object.","user":{"login":"guptaamol","id":22221333,"node_id":"MDQ6VXNlcjIyMjIxMzMz","avatar_url":"https://avatars0.githubusercontent.com/u/22221333?v=4","gravatar_id":"","url":"https://api.github.com/users/guptaamol","html_url":"https://github.com/guptaamol","followers_url":"https://api.github.com/users/guptaamol/followers","following_url":"https://api.github.com/users/guptaamol/following{/other_user}","gists_url":"https://api.github.com/users/guptaamol/gists{/gist_id}","starred_url":"https://api.github.com/users/guptaamol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guptaamol/subscriptions","organizations_url":"https://api.github.com/users/guptaamol/orgs","repos_url":"https://api.github.com/users/guptaamol/repos","events_url":"https://api.github.com/users/guptaamol/events{/privacy}","received_events_url":"https://api.github.com/users/guptaamol/received_events","type":"User","site_admin":false},"labels":[{"id":113971558,"node_id":"MDU6TGFiZWwxMTM5NzE1NTg=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-25T10:19:25Z","updated_at":"2018-09-25T18:50:27Z","closed_at":null,"author_association":"NONE","body":"<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the \"Common Feature Requests\" section.\r\n\r\n-->\r\n## Search Terms\r\noptional prop inference.\r\n\r\n<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->\r\n\r\n## Suggestion\r\nOptional Arguments type creation.\r\n<!-- A summary of what you'd like to see added or changed -->\r\n\r\n## Use Cases\r\n\r\n<!--\r\nWhat do you want to use this for?\r\nWhat shortcomings exist with current approaches?\r\n-->\r\nCurrently we need to define a partial to infer optional types.\r\nI was hoping if we could create something as mentioned in the example for inferring optional props.\r\n\r\n## Examples\r\nconst someObj = {a: 'someString', b: undefined as number};\r\ntype someObjType = typeof someObj;\r\nsomeObjType = {a: string, b?: number}\r\n\r\n<!-- Show how this would be used and what the behavior would be -->\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n* [ ] This wouldn't be a breaking change in existing TypeScript / JavaScript code\r\n* [ ] 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\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/424458827","html_url":"https://github.com/Microsoft/TypeScript/issues/27336#issuecomment-424458827","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/27336","id":424458827,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQ1ODgyNw==","user":{"login":"andy-ms","id":19274678,"node_id":"MDQ6VXNlcjE5Mjc0Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/19274678?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-ms","html_url":"https://github.com/andy-ms","followers_url":"https://api.github.com/users/andy-ms/followers","following_url":"https://api.github.com/users/andy-ms/following{/other_user}","gists_url":"https://api.github.com/users/andy-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-ms/subscriptions","organizations_url":"https://api.github.com/users/andy-ms/orgs","repos_url":"https://api.github.com/users/andy-ms/repos","events_url":"https://api.github.com/users/andy-ms/events{/privacy}","received_events_url":"https://api.github.com/users/andy-ms/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T18:50:27Z","updated_at":"2018-09-25T18:50:27Z","author_association":"CONTRIBUTOR","body":"Try adding `\"stict\": true` to your tsconfig to avoid the inferred type of `b` being `any`."}}
{"actor":{"display_login":"andy-ms"}}