{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/26410","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/26410/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/26410/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/26410/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26410","id":330928751,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzODAyMTMz","number":26410,"title":"node: make streams generic","user":{"login":"KonanMentor","id":4678737,"node_id":"MDQ6VXNlcjQ2Nzg3Mzc=","avatar_url":"https://avatars2.githubusercontent.com/u/4678737?v=4","gravatar_id":"","url":"https://api.github.com/users/KonanMentor","html_url":"https://github.com/KonanMentor","followers_url":"https://api.github.com/users/KonanMentor/followers","following_url":"https://api.github.com/users/KonanMentor/following{/other_user}","gists_url":"https://api.github.com/users/KonanMentor/gists{/gist_id}","starred_url":"https://api.github.com/users/KonanMentor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KonanMentor/subscriptions","organizations_url":"https://api.github.com/users/KonanMentor/orgs","repos_url":"https://api.github.com/users/KonanMentor/repos","events_url":"https://api.github.com/users/KonanMentor/events{/privacy}","received_events_url":"https://api.github.com/users/KonanMentor/received_events","type":"User","site_admin":false},"labels":[{"id":397523192,"node_id":"MDU6TGFiZWwzOTc1MjMxOTI=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Awaiting%20reviewer%20feedback","name":"Awaiting reviewer feedback","color":"0052cc","default":false},{"id":583294474,"node_id":"MDU6TGFiZWw1ODMyOTQ0NzQ=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Has%20Merge%20Conflict","name":"Has Merge Conflict","color":"b60205","default":false},{"id":684321576,"node_id":"MDU6TGFiZWw2ODQzMjE1NzY=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Popular%20package","name":"Popular package","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-06-10T00:17:20Z","updated_at":"2018-06-13T22:01:55Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/26410","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26410","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26410.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26410.patch"},"body":"## Motivation\r\n\r\n1. Given the fact that `Readable` stream [became](https://github.com/nodejs/node/commit/61b4d60c5d) `AsyncIterable` in Node v10.0.0, I expect `for-await-of` way of iterating over streams to become more popular. As a result people may start using native streams more often. And probably they will be using the streams with their own data types (i.e. in object mode), so it will be great to check these data types.\r\n2. There is no type support for streams in object mode. The only type streams operate is `string | Buffer` or `any`\r\n\r\n## Use case\r\n\r\nMy use case is iterating over documents returned by MongoDB. So I could write\r\n\r\n```ts\r\nconst docs = db.collection<MyDataType>('...').find();\r\n// docs is Cursor<MyDataType>, which extends Readable stream\r\nfor await (const doc of docs) {\r\n  // I expect doc to be MyDataType here, but it is string | Buffer at the moment\r\n}\r\n```\r\n---\r\n\r\n- [x] Use a meaningful title for the pull request. Include the name of the package modified.\r\n- [x] Test the change in your own code. (Compile and run.)\r\n- [x] Add or edit tests to reflect the change. (Run with `npm test`.)\r\n- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).\r\n- [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).\r\n- [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).\r\n\r\nIf changing an existing definition:\r\n- [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://nodejs.org/api/stream.html\r\n- [x] Increase the version number in the header if appropriate. (not appropriate)\r\n- [x] If you are making substantial changes, consider adding a `tslint.json` containing `{ \"extends\": \"dtslint/dt.json\" }`. (already done)\r\n"},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/397102019","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26410#issuecomment-397102019","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/26410","id":397102019,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzEwMjAxOQ==","user":{"login":"minestarks","id":16928427,"node_id":"MDQ6VXNlcjE2OTI4NDI3","avatar_url":"https://avatars1.githubusercontent.com/u/16928427?v=4","gravatar_id":"","url":"https://api.github.com/users/minestarks","html_url":"https://github.com/minestarks","followers_url":"https://api.github.com/users/minestarks/followers","following_url":"https://api.github.com/users/minestarks/following{/other_user}","gists_url":"https://api.github.com/users/minestarks/gists{/gist_id}","starred_url":"https://api.github.com/users/minestarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minestarks/subscriptions","organizations_url":"https://api.github.com/users/minestarks/orgs","repos_url":"https://api.github.com/users/minestarks/repos","events_url":"https://api.github.com/users/minestarks/events{/privacy}","received_events_url":"https://api.github.com/users/minestarks/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T22:01:55Z","updated_at":"2018-06-13T22:01:55Z","author_association":"CONTRIBUTOR","body":"Thanks @DanielRosenwasser , that makes me feel better about this.\r\n\r\n@KonanMentor could you back up the older version under v9?"}}
{"actor":{"display_login":"minestarks"}}