{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc-node/pulls/comments/149740195","pull_request_review_id":75180929,"id":149740195,"diff_hunk":"@@ -193,7 +195,7 @@ declare module \"grpc\" {\n      * @param implementation Map of method names to method implementation\n      * for the provided service.\n      */\n-    addService(service: Service, implementation: { [name: string]: handleCall }): void;\n+    addService<T>(service: Service<T>, implementation: T): void;","path":"packages/grpc-native-core/index.d.ts","position":48,"original_position":48,"commit_id":"43ca1fce98245819fc7199f2999dc09552132347","original_commit_id":"43ca1fce98245819fc7199f2999dc09552132347","user":{"login":"murgatroid99","id":961599,"avatar_url":"https://avatars3.githubusercontent.com/u/961599?v=4","gravatar_id":"","url":"https://api.github.com/users/murgatroid99","html_url":"https://github.com/murgatroid99","followers_url":"https://api.github.com/users/murgatroid99/followers","following_url":"https://api.github.com/users/murgatroid99/following{/other_user}","gists_url":"https://api.github.com/users/murgatroid99/gists{/gist_id}","starred_url":"https://api.github.com/users/murgatroid99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murgatroid99/subscriptions","organizations_url":"https://api.github.com/users/murgatroid99/orgs","repos_url":"https://api.github.com/users/murgatroid99/repos","events_url":"https://api.github.com/users/murgatroid99/events{/privacy}","received_events_url":"https://api.github.com/users/murgatroid99/received_events","type":"User","site_admin":false},"body":"This seems to make the function signature less useful by removing the specific definition of the type of `implementation`, and I don't see any clear benefit. Because the `Service<T>` definition doesn't even use the type parameter `T`, there is no useful information about how the types of the two arguments should be related.\r\n\r\nAlso, the original file is actually incorrect here. The type of the `service` argument should be `ServiceDefinition`.","created_at":"2017-11-08T17:29:56Z","updated_at":"2017-11-08T17:49:32Z","html_url":"https://github.com/grpc/grpc-node/pull/84#discussion_r149740195","pull_request_url":"https://api.github.com/repos/grpc/grpc-node/pulls/84","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/comments/149740195"},"html":{"href":"https://github.com/grpc/grpc-node/pull/84#discussion_r149740195"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-node/pulls/84","id":151398488,"html_url":"https://github.com/grpc/grpc-node/pull/84","diff_url":"https://github.com/grpc/grpc-node/pull/84.diff","patch_url":"https://github.com/grpc/grpc-node/pull/84.patch","issue_url":"https://api.github.com/repos/grpc/grpc-node/issues/84","number":84,"state":"open","locked":false,"title":"Generic Ts definitions","user":{"login":"andrew8er","id":179225,"avatar_url":"https://avatars1.githubusercontent.com/u/179225?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew8er","html_url":"https://github.com/andrew8er","followers_url":"https://api.github.com/users/andrew8er/followers","following_url":"https://api.github.com/users/andrew8er/following{/other_user}","gists_url":"https://api.github.com/users/andrew8er/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew8er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew8er/subscriptions","organizations_url":"https://api.github.com/users/andrew8er/orgs","repos_url":"https://api.github.com/users/andrew8er/repos","events_url":"https://api.github.com/users/andrew8er/events{/privacy}","received_events_url":"https://api.github.com/users/andrew8er/received_events","type":"User","site_admin":false},"body":"I added some generic type parameters to the index.d.ts, in particular:\r\n```ts\r\nloadObject<T = GrpcObject>(…): T;\r\nload<T = GrpcObject>(…): T;\r\n```\r\ncan now be parametrised to an autogenerated or handwritten specific type. Also in\r\n```ts\r\nclass Server {\r\n   // ...\r\n   addService<T>(service: Service<T>, implementation: T): void;\r\n   // ...\r\n}\r\n```\r\nthe implementation can now be typechecked against a specific type.\r\n\r\nThis is most probably a breaking change for Ts projects. When supplying default values for all generic parameters, it would be non breaking, but that would defeat the point somehow.","created_at":"2017-11-08T14:34:25Z","updated_at":"2017-11-08T17:49:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca7f483464ef0c29fa1fb79c81985ac9a57599c5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc-node/pulls/84/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc-node/pulls/84/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc-node/issues/84/comments","statuses_url":"https://api.github.com/repos/grpc/grpc-node/statuses/43ca1fce98245819fc7199f2999dc09552132347","head":{"label":"andrew8er:feature/generic-ts-definitions","ref":"feature/generic-ts-definitions","sha":"43ca1fce98245819fc7199f2999dc09552132347","user":{"login":"andrew8er","id":179225,"avatar_url":"https://avatars1.githubusercontent.com/u/179225?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew8er","html_url":"https://github.com/andrew8er","followers_url":"https://api.github.com/users/andrew8er/followers","following_url":"https://api.github.com/users/andrew8er/following{/other_user}","gists_url":"https://api.github.com/users/andrew8er/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew8er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew8er/subscriptions","organizations_url":"https://api.github.com/users/andrew8er/orgs","repos_url":"https://api.github.com/users/andrew8er/repos","events_url":"https://api.github.com/users/andrew8er/events{/privacy}","received_events_url":"https://api.github.com/users/andrew8er/received_events","type":"User","site_admin":false},"repo":{"id":109415589,"name":"grpc-node","full_name":"andrew8er/grpc-node","owner":{"login":"andrew8er","id":179225,"avatar_url":"https://avatars1.githubusercontent.com/u/179225?v=4","gravatar_id":"","url":"https://api.github.com/users/andrew8er","html_url":"https://github.com/andrew8er","followers_url":"https://api.github.com/users/andrew8er/followers","following_url":"https://api.github.com/users/andrew8er/following{/other_user}","gists_url":"https://api.github.com/users/andrew8er/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew8er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew8er/subscriptions","organizations_url":"https://api.github.com/users/andrew8er/orgs","repos_url":"https://api.github.com/users/andrew8er/repos","events_url":"https://api.github.com/users/andrew8er/events{/privacy}","received_events_url":"https://api.github.com/users/andrew8er/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrew8er/grpc-node","description":"gRPC for Node.js","fork":true,"url":"https://api.github.com/repos/andrew8er/grpc-node","forks_url":"https://api.github.com/repos/andrew8er/grpc-node/forks","keys_url":"https://api.github.com/repos/andrew8er/grpc-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrew8er/grpc-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrew8er/grpc-node/teams","hooks_url":"https://api.github.com/repos/andrew8er/grpc-node/hooks","issue_events_url":"https://api.github.com/repos/andrew8er/grpc-node/issues/events{/number}","events_url":"https://api.github.com/repos/andrew8er/grpc-node/events","assignees_url":"https://api.github.com/repos/andrew8er/grpc-node/assignees{/user}","branches_url":"https://api.github.com/repos/andrew8er/grpc-node/branches{/branch}","tags_url":"https://api.github.com/repos/andrew8er/grpc-node/tags","blobs_url":"https://api.github.com/repos/andrew8er/grpc-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrew8er/grpc-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrew8er/grpc-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrew8er/grpc-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrew8er/grpc-node/statuses/{sha}","languages_url":"https://api.github.com/repos/andrew8er/grpc-node/languages","stargazers_url":"https://api.github.com/repos/andrew8er/grpc-node/stargazers","contributors_url":"https://api.github.com/repos/andrew8er/grpc-node/contributors","subscribers_url":"https://api.github.com/repos/andrew8er/grpc-node/subscribers","subscription_url":"https://api.github.com/repos/andrew8er/grpc-node/subscription","commits_url":"https://api.github.com/repos/andrew8er/grpc-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrew8er/grpc-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrew8er/grpc-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrew8er/grpc-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrew8er/grpc-node/contents/{+path}","compare_url":"https://api.github.com/repos/andrew8er/grpc-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrew8er/grpc-node/merges","archive_url":"https://api.github.com/repos/andrew8er/grpc-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrew8er/grpc-node/downloads","issues_url":"https://api.github.com/repos/andrew8er/grpc-node/issues{/number}","pulls_url":"https://api.github.com/repos/andrew8er/grpc-node/pulls{/number}","milestones_url":"https://api.github.com/repos/andrew8er/grpc-node/milestones{/number}","notifications_url":"https://api.github.com/repos/andrew8er/grpc-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrew8er/grpc-node/labels{/name}","releases_url":"https://api.github.com/repos/andrew8er/grpc-node/releases{/id}","deployments_url":"https://api.github.com/repos/andrew8er/grpc-node/deployments","created_at":"2017-11-03T16:04:22Z","updated_at":"2017-11-03T16:04:24Z","pushed_at":"2017-11-08T14:25:08Z","git_url":"git://github.com/andrew8er/grpc-node.git","ssh_url":"git@github.com:andrew8er/grpc-node.git","clone_url":"https://github.com/andrew8er/grpc-node.git","svn_url":"https://github.com/andrew8er/grpc-node","homepage":"https://grpc.io","size":1420,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"d156ca5be2bd4045bbd370d098753a9c9f81e63d","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":99148158,"name":"grpc-node","full_name":"grpc/grpc-node","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc-node","description":"gRPC for Node.js","fork":false,"url":"https://api.github.com/repos/grpc/grpc-node","forks_url":"https://api.github.com/repos/grpc/grpc-node/forks","keys_url":"https://api.github.com/repos/grpc/grpc-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc-node/teams","hooks_url":"https://api.github.com/repos/grpc/grpc-node/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc-node/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc-node/events","assignees_url":"https://api.github.com/repos/grpc/grpc-node/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc-node/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc-node/tags","blobs_url":"https://api.github.com/repos/grpc/grpc-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc-node/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc-node/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc-node/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc-node/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc-node/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc-node/subscription","commits_url":"https://api.github.com/repos/grpc/grpc-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc-node/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc-node/merges","archive_url":"https://api.github.com/repos/grpc/grpc-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc-node/downloads","issues_url":"https://api.github.com/repos/grpc/grpc-node/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc-node/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc-node/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc-node/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc-node/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc-node/deployments","created_at":"2017-08-02T18:20:33Z","updated_at":"2017-11-08T13:19:09Z","pushed_at":"2017-11-08T14:34:26Z","git_url":"git://github.com/grpc/grpc-node.git","ssh_url":"git@github.com:grpc/grpc-node.git","clone_url":"https://github.com/grpc/grpc-node.git","svn_url":"https://github.com/grpc/grpc-node","homepage":"https://grpc.io","size":1420,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":19,"forks":13,"open_issues":19,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/84"},"html":{"href":"https://github.com/grpc/grpc-node/pull/84"},"issue":{"href":"https://api.github.com/repos/grpc/grpc-node/issues/84"},"comments":{"href":"https://api.github.com/repos/grpc/grpc-node/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc-node/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc-node/statuses/43ca1fce98245819fc7199f2999dc09552132347"}},"author_association":"NONE"}}
{"actor":{"display_login":"murgatroid99"}}