{"action":"closed","number":12858,"pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858","id":94742207,"html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12858","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12858.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12858.patch","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/12858","number":12858,"state":"closed","locked":false,"title":"[types-2.0] D3 strictNullChecks Batch 1","user":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"body":"Please fill in this template.\r\n\r\n- [x] Prefer to make your PR against the `types-2.0` branch.\r\n- [x] Test the change in your own code.\r\n- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request).\r\n- [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped#common-mistakes).\r\n- [x] Run `npm run lint -- package-name` if a `tslint.json` is present.\r\n\r\nIf adding a new definition:\r\n- [ ] The package does not provide its own types, and you can not add them.\r\n- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.\r\n- [ ] Run `tsc` without errors.\r\n- [ ] Include the required [files](https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package) and header. Base these on the README, *not* on an existing project.\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: <<not applicable>>\r\n- [x] Increase the version number in the header if appropriate.\r\n\r\nRelated to Issue #11365, replaces PR #12566.\r\n\r\n@gustavderdrache @alejo90 @alitaheri \r\n\r\nThanks to @alejo90 @alitaheri for the initial PRs, after some thought and reviewing some alternative approaches, I decided to create a new PR, mostly, because I noticed there was some 'technical debt' in the tests to remove along the way, which I had parked for follow-up. Did not wan to impose that on someone else.\r\n\r\nI will follow-up with **d3-force** as soon as I have a chance as the next in line, because you had it in  PR #12566. There are also the others,with dependencies on d3-selection, which should be next in line  for validation and enhancement.\r\n\r\n@gustavderdrache for d3-selection-multi I made the assumption that, when a `ValueFn` is used, it always evaluates to a `ValueMap`, never to `null` for purposes  of `strictNullChecking`. As a corollary, the \"no-op\" for a given evaluated Value Function is the empty object `{}`.\r\n\r\ncc @yuit\r\n\r\n* **(d3-selection) [Enhancement]**: Validated, updated and activated to enforece `strictNullChecks`. `BaseType` updated to include `null`. As a result of this approach, the **developer must explicitly** include `| null`, if a Selection or a (sub-)selecting method may contain `null` element(s). By the same token, the `node()` method, will return `null` only, if the Selection to which it was applied may contain `null` element(s).\r\n* **(d3-selection) [Enhancement]**: Added additional signature to `filter(...)` method such that a generic can be used to control the type of the filtered elements, should they be a subset of the unfiltered types.\r\n* (d3-selection) [Enhancement]: Added `Document` to `BaseType` union type.\r\n* **(d3-transition) [Enhancement]**: Validated, updated and activated to enforece `strictNullChecks`. `BaseType` updated to include `null`. As a result of this approach, the developer must explicitly include `| null`, if a Transition or a (sub-)selecting method may contain `null` element(s). By the same token, the `node()` method, will return `null` only, if the Transition to which it was applied may contain `null` element(s).\r\n* **(d3-transition) [Enhancement]**: Added additional signature to `filter(...)` method such that a generic can be used to control the type of the filtered elements, should they be a subset of the unfiltered types.\r\n* **(d3-selection-multi) [Enhancement]**: updated `ValueMap` type use extension of selection/transition `BaseType` as defined above consistent  with `strictNullChecks`.\r\n* **(d3-selection-multi) [Test Fix]**: Updated tests where a Value Function is used to return a ValueMap for each selected item, as the ValueMap must be defined as a mapping object idiomatically, the test was changed to never return `null` as a result of the value function. Instead it returns `{}`, when no updates are required for the currently iterated selected element.\r\n* In general, for all three above modules: Tests have been updated to be more explicit about type-checking inside callback functions. Also, where shortcuts where taken in the shape tests to simply test interface/signature contracts, without necessary variable initialization, mock initializations have been included. This is necessitated by enabling `strictNullChecks`.","created_at":"2016-11-22T03:31:08Z","updated_at":"2016-12-03T03:28:02Z","closed_at":"2016-12-03T03:28:01Z","merged_at":"2016-12-03T03:28:01Z","merge_commit_sha":"c633e6b9b78b5a4dfd8c0716b3be654999cc0045","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858/commits","review_comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858/comments","review_comment_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/12858/comments","statuses_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/statuses/70842079eb56036797c50b59195ae516d22f54a2","head":{"label":"tomwanzek:d3-strict-batch-1","ref":"d3-strict-batch-1","sha":"70842079eb56036797c50b59195ae516d22f54a2","user":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"repo":{"id":63460929,"name":"DefinitelyTyped","full_name":"tomwanzek/DefinitelyTyped","owner":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomwanzek/DefinitelyTyped","description":"The repository for high quality TypeScript type definitions.","fork":true,"url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped","forks_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/forks","keys_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/teams","hooks_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/hooks","issue_events_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/issues/events{/number}","events_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/events","assignees_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/assignees{/user}","branches_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/branches{/branch}","tags_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/tags","blobs_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/statuses/{sha}","languages_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/languages","stargazers_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/stargazers","contributors_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/contributors","subscribers_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/subscribers","subscription_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/subscription","commits_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/contents/{+path}","compare_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/merges","archive_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/downloads","issues_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/issues{/number}","pulls_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/pulls{/number}","milestones_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/milestones{/number}","notifications_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/labels{/name}","releases_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/releases{/id}","deployments_url":"https://api.github.com/repos/tomwanzek/DefinitelyTyped/deployments","created_at":"2016-07-16T02:07:41Z","updated_at":"2016-07-16T02:07:48Z","pushed_at":"2016-12-02T18:10:30Z","git_url":"git://github.com/tomwanzek/DefinitelyTyped.git","ssh_url":"git@github.com:tomwanzek/DefinitelyTyped.git","clone_url":"https://github.com/tomwanzek/DefinitelyTyped.git","svn_url":"https://github.com/tomwanzek/DefinitelyTyped","homepage":"http://definitelytyped.org/","size":138535,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DefinitelyTyped:types-2.0","ref":"types-2.0","sha":"f7eb779ec69267632908fcf39cf557d308dab931","user":{"login":"DefinitelyTyped","id":3637556,"avatar_url":"https://avatars.githubusercontent.com/u/3637556?v=3","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,"name":"DefinitelyTyped","full_name":"DefinitelyTyped/DefinitelyTyped","owner":{"login":"DefinitelyTyped","id":3637556,"avatar_url":"https://avatars.githubusercontent.com/u/3637556?v=3","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},"private":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":"2016-12-02T20:05:24Z","pushed_at":"2016-12-03T03:28:02Z","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":250853,"stargazers_count":9076,"watchers_count":9076,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7214,"mirror_url":null,"open_issues_count":1147,"forks":7214,"open_issues":1147,"watchers":9076,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858"},"html":{"href":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12858"},"issue":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/12858"},"comments":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/12858/comments"},"review_comments":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858/comments"},"review_comment":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/12858/commits"},"statuses":{"href":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/statuses/70842079eb56036797c50b59195ae516d22f54a2"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"andy-ms","id":19274678,"avatar_url":"https://avatars.githubusercontent.com/u/19274678?v=3","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},"comments":35,"review_comments":11,"commits":14,"additions":980,"deletions":348,"changed_files":28}}
{"actor":{"display_login":"andy-ms"}}