{"action":"created","comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments/234557896","pull_request_review_id":176220630,"id":234557896,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDU1Nzg5Ng==","diff_hunk":"@@ -523,7 +524,7 @@ declare namespace Sinon {\n          * Makes the stub call the provided @param func when invoked.\n          * @param func\n          */\n-        callsFake(func: (...args: U) => V): SinonStub<U, V>;\n+        callsFake(func: () => V): SinonStub<U, V>;","path":"types/sinon/index.d.ts","position":null,"original_position":13,"commit_id":"fa79d1b4cfaf5511321770e989a76e939fdfb512","original_commit_id":"cf127dd3c39bb92e5abd830f7c5bac0100f4207a","user":{"login":"johnjesse","id":6839660,"node_id":"MDQ6VXNlcjY4Mzk2NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/6839660?v=4","gravatar_id":"","url":"https://api.github.com/users/johnjesse","html_url":"https://github.com/johnjesse","followers_url":"https://api.github.com/users/johnjesse/followers","following_url":"https://api.github.com/users/johnjesse/following{/other_user}","gists_url":"https://api.github.com/users/johnjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjesse/subscriptions","organizations_url":"https://api.github.com/users/johnjesse/orgs","repos_url":"https://api.github.com/users/johnjesse/repos","events_url":"https://api.github.com/users/johnjesse/events{/privacy}","received_events_url":"https://api.github.com/users/johnjesse/received_events","type":"User","site_admin":false},"body":"PR to fix is in, #30656 ","created_at":"2018-11-19T10:06:58Z","updated_at":"2018-11-19T10:06:58Z","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442#discussion_r234557896","pull_request_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments/234557896"},"html":{"href":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442#discussion_r234557896"},"pull_request":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442"}},"in_reply_to_id":234531825},"pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442","id":229924504,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5OTI0NTA0","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442.patch","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30442","number":30442,"state":"closed","locked":false,"title":"@types/sinon - add type inference for stub/spy arguments and return types","user":{"login":"johnjesse","id":6839660,"node_id":"MDQ6VXNlcjY4Mzk2NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/6839660?v=4","gravatar_id":"","url":"https://api.github.com/users/johnjesse","html_url":"https://github.com/johnjesse","followers_url":"https://api.github.com/users/johnjesse/followers","following_url":"https://api.github.com/users/johnjesse/following{/other_user}","gists_url":"https://api.github.com/users/johnjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjesse/subscriptions","organizations_url":"https://api.github.com/users/johnjesse/orgs","repos_url":"https://api.github.com/users/johnjesse/repos","events_url":"https://api.github.com/users/johnjesse/events{/privacy}","received_events_url":"https://api.github.com/users/johnjesse/received_events","type":"User","site_admin":false},"body":"Please fill in this template.\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- [ ] Add or edit tests to reflect the change. (Run with `npm test`.) - _No tests yet, wanted to discuss the change first_\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). - _ran tsc and got no problems... it failed running tslint, it failed to assert the path_ `DefinitelyTyped/types/xxx` - _even though I have that folder structure... potentially a casing issue?_\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: <<url here>> - _The documentation hasn't changed, my change just suggests that the typings can be tighter._\r\n- [x] Increase the version number in the header if appropriate. - _No version change_\r\n- [x] If you are making substantial changes, consider adding a `tslint.json` containing `{ \"extends\": \"dtslint/dt.json\" }`.\r\n\r\nI've added generic type inference to the spy and stub calls. the key line for the spy is this:\r\n\r\n```\r\n    interface SinonSpyStatic {\r\n        /**\r\n         * Creates an anonymous function that records arguments, this value, exceptions and return values for all calls.\r\n         */\r\n        (): SinonSpy;\r\n        /**\r\n         * Spies on the provided function\r\n         */\r\n        (func: Function): SinonSpy;\r\n        /**\r\n         * Creates a spy for object.method and replaces the original method with the spy.\r\n         * An exception is thrown if the property is not already a function.\r\n         * The spy acts exactly like the original method in all cases.\r\n         * The original method can be restored by calling object.method.restore().\r\n         * The returned spy is the function object which replaced the original method. spy === object.method.\r\n         */\r\n        <T, K extends keyof T>(obj: T, method: K): T[K] extends (\r\n            ...args: infer U\r\n        ) => infer V\r\n            ? SinonSpy<U, V>\r\n            : SinonSpy;\r\n    }\r\n```\r\n\r\nBasically, we can infer the types of the arguments of the function being stubbed and the return type of that function. Then we can use this within the spy/stub API such that, when you are accessing the arguments/return of a stub/spy you get type safety.\r\n\r\nI haven't added tests yet, wanted to make sure people thought it was a good idea before I bothered. If we do think it's a good idea then I'll add them\r\n","created_at":"2018-11-11T01:23:36Z","updated_at":"2018-11-19T10:06:58Z","closed_at":"2018-11-18T17:07:43Z","merged_at":"2018-11-18T17:07:43Z","merge_commit_sha":"8c99cf5fedf78629c6ff7738a1cca134279f3afa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":644095236,"node_id":"MDU6TGFiZWw2NDQwOTUyMzY=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Merge:Express","name":"Merge:Express","color":"00AA00","default":false},{"id":905334095,"node_id":"MDU6TGFiZWw5MDUzMzQwOTU=","url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Owner%20Approved","name":"Owner Approved","color":"0e8a16","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}],"milestone":null,"commits_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442/commits","review_comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442/comments","review_comment_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30442/comments","statuses_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/statuses/fa79d1b4cfaf5511321770e989a76e939fdfb512","head":{"label":"johnjesse:AddSinonGenericTypes","ref":"AddSinonGenericTypes","sha":"fa79d1b4cfaf5511321770e989a76e939fdfb512","user":{"login":"johnjesse","id":6839660,"node_id":"MDQ6VXNlcjY4Mzk2NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/6839660?v=4","gravatar_id":"","url":"https://api.github.com/users/johnjesse","html_url":"https://github.com/johnjesse","followers_url":"https://api.github.com/users/johnjesse/followers","following_url":"https://api.github.com/users/johnjesse/following{/other_user}","gists_url":"https://api.github.com/users/johnjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjesse/subscriptions","organizations_url":"https://api.github.com/users/johnjesse/orgs","repos_url":"https://api.github.com/users/johnjesse/repos","events_url":"https://api.github.com/users/johnjesse/events{/privacy}","received_events_url":"https://api.github.com/users/johnjesse/received_events","type":"User","site_admin":false},"repo":{"id":114905331,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ5MDUzMzE=","name":"DefinitelyTyped","full_name":"johnjesse/DefinitelyTyped","private":false,"owner":{"login":"johnjesse","id":6839660,"node_id":"MDQ6VXNlcjY4Mzk2NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/6839660?v=4","gravatar_id":"","url":"https://api.github.com/users/johnjesse","html_url":"https://github.com/johnjesse","followers_url":"https://api.github.com/users/johnjesse/followers","following_url":"https://api.github.com/users/johnjesse/following{/other_user}","gists_url":"https://api.github.com/users/johnjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjesse/subscriptions","organizations_url":"https://api.github.com/users/johnjesse/orgs","repos_url":"https://api.github.com/users/johnjesse/repos","events_url":"https://api.github.com/users/johnjesse/events{/privacy}","received_events_url":"https://api.github.com/users/johnjesse/received_events","type":"User","site_admin":false},"html_url":"https://github.com/johnjesse/DefinitelyTyped","description":"The repository for high quality TypeScript type definitions.","fork":true,"url":"https://api.github.com/repos/johnjesse/DefinitelyTyped","forks_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/forks","keys_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/teams","hooks_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/hooks","issue_events_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/issues/events{/number}","events_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/events","assignees_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/assignees{/user}","branches_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/branches{/branch}","tags_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/tags","blobs_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/statuses/{sha}","languages_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/languages","stargazers_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/stargazers","contributors_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/contributors","subscribers_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/subscribers","subscription_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/subscription","commits_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/issues/comments{/number}","contents_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/contents/{+path}","compare_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/merges","archive_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/downloads","issues_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/issues{/number}","pulls_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/pulls{/number}","milestones_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/milestones{/number}","notifications_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/labels{/name}","releases_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/releases{/id}","deployments_url":"https://api.github.com/repos/johnjesse/DefinitelyTyped/deployments","created_at":"2017-12-20T15:56:41Z","updated_at":"2018-11-19T09:45:18Z","pushed_at":"2018-11-19T09:54:55Z","git_url":"git://github.com/johnjesse/DefinitelyTyped.git","ssh_url":"git@github.com:johnjesse/DefinitelyTyped.git","clone_url":"https://github.com/johnjesse/DefinitelyTyped.git","svn_url":"https://github.com/johnjesse/DefinitelyTyped","homepage":"http://definitelytyped.org/","size":378299,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DefinitelyTyped:master","ref":"master","sha":"7b95fc3d184ef9ff69bd83f1030c7f38774d1bc0","user":{"login":"DefinitelyTyped","id":3637556,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Mzc1NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3637556?v=4","gravatar_id":"","url":"https://api.github.com/users/DefinitelyTyped","html_url":"https://github.com/DefinitelyTyped","followers_url":"https://api.github.com/users/DefinitelyTyped/followers","following_url":"https://api.github.com/users/DefinitelyTyped/following{/other_user}","gists_url":"https://api.github.com/users/DefinitelyTyped/gists{/gist_id}","starred_url":"https://api.github.com/users/DefinitelyTyped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DefinitelyTyped/subscriptions","organizations_url":"https://api.github.com/users/DefinitelyTyped/orgs","repos_url":"https://api.github.com/users/DefinitelyTyped/repos","events_url":"https://api.github.com/users/DefinitelyTyped/events{/privacy}","received_events_url":"https://api.github.com/users/DefinitelyTyped/received_events","type":"Organization","site_admin":false},"repo":{"id":6093316,"node_id":"MDEwOlJlcG9zaXRvcnk2MDkzMzE2","name":"DefinitelyTyped","full_name":"DefinitelyTyped/DefinitelyTyped","private":false,"owner":{"login":"DefinitelyTyped","id":3637556,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Mzc1NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3637556?v=4","gravatar_id":"","url":"https://api.github.com/users/DefinitelyTyped","html_url":"https://github.com/DefinitelyTyped","followers_url":"https://api.github.com/users/DefinitelyTyped/followers","following_url":"https://api.github.com/users/DefinitelyTyped/following{/other_user}","gists_url":"https://api.github.com/users/DefinitelyTyped/gists{/gist_id}","starred_url":"https://api.github.com/users/DefinitelyTyped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DefinitelyTyped/subscriptions","organizations_url":"https://api.github.com/users/DefinitelyTyped/orgs","repos_url":"https://api.github.com/users/DefinitelyTyped/repos","events_url":"https://api.github.com/users/DefinitelyTyped/events{/privacy}","received_events_url":"https://api.github.com/users/DefinitelyTyped/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped","description":"The repository for high quality TypeScript type definitions.","fork":false,"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","forks_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/forks","keys_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/teams","hooks_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/hooks","issue_events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/events{/number}","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/events","assignees_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/assignees{/user}","branches_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/branches{/branch}","tags_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/tags","blobs_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/git/refs{/sha}","trees_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/statuses/{sha}","languages_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/languages","stargazers_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/stargazers","contributors_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/contributors","subscribers_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/subscribers","subscription_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/subscription","commits_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/commits{/sha}","git_commits_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/git/commits{/sha}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/comments{/number}","issue_comment_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments{/number}","contents_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/contents/{+path}","compare_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/merges","archive_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/downloads","issues_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues{/number}","pulls_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls{/number}","milestones_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/milestones{/number}","notifications_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels{/name}","releases_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/releases{/id}","deployments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/deployments","created_at":"2012-10-05T16:39:45Z","updated_at":"2018-11-19T09:27:49Z","pushed_at":"2018-11-19T10:05:53Z","git_url":"git://github.com/DefinitelyTyped/DefinitelyTyped.git","ssh_url":"git@github.com:DefinitelyTyped/DefinitelyTyped.git","clone_url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","svn_url":"https://github.com/DefinitelyTyped/DefinitelyTyped","homepage":"http://definitelytyped.org/","size":378283,"stargazers_count":18591,"watchers_count":18591,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15399,"mirror_url":null,"archived":false,"open_issues_count":2548,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":15399,"open_issues":2548,"watchers":18591,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442"},"html":{"href":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442"},"issue":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30442"},"comments":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/30442/comments"},"review_comments":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442/comments"},"review_comment":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/30442/commits"},"statuses":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/statuses/fa79d1b4cfaf5511321770e989a76e939fdfb512"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"johnjesse"}}