{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3215","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3215/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3215/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3215/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3215","id":78054310,"number":3215,"title":"New APIs added to lib.d.ts may break client codes. Allow duplicated members in interfaces? Make lib.d.ts overridable?","user":{"login":"duanyao","id":1684137,"avatar_url":"https://avatars.githubusercontent.com/u/1684137?v=3","gravatar_id":"","url":"https://api.github.com/users/duanyao","html_url":"https://github.com/duanyao","followers_url":"https://api.github.com/users/duanyao/followers","following_url":"https://api.github.com/users/duanyao/following{/other_user}","gists_url":"https://api.github.com/users/duanyao/gists{/gist_id}","starred_url":"https://api.github.com/users/duanyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duanyao/subscriptions","organizations_url":"https://api.github.com/users/duanyao/orgs","repos_url":"https://api.github.com/users/duanyao/repos","events_url":"https://api.github.com/users/duanyao/events{/privacy}","received_events_url":"https://api.github.com/users/duanyao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"milestone":null,"comments":20,"created_at":"2015-05-19T11:43:47Z","updated_at":"2015-12-29T17:20:48Z","closed_at":null,"body":"I noticed that recently a lot of new APIs are added to `lib.d.ts`. Of cause this is a good thing, however my code breaks badly because of such update.\r\n\r\nPreviously I had added a lot of declarations in my code for HTML5 APIs that were missing in `lib.d.ts` . Now some of them are added to `lib.d.ts`, and I get quite a few \"duplicated identifier\" errors. For example, I had added this piece to play with fullscreen:\r\n```javascript\r\ninterface Document {\r\n//...\r\n  fullscreenEnabled: boolean;\r\n  mozFullScreenEnabled: boolean;\r\n  webkitFullscreenEnabled: boolean;\r\n}\r\n```\r\nNow `fullscreenEnabled` and `webkitFullscreenEnabled` are available in `lib.d.ts`, and my code breaks, and I have to remove them. However, you are still missing `mozFullScreenEnabled` right? -- well, waiting for the next break.\r\n\r\nWeb platforms are constantly evolving, it is not practical to expect `lib.d.ts` always up to date, so developers just have to write such compensating declarations from time to time. Can TS avoid such breaks? I have a few ideas:\r\n\r\n* Allow duplicated members in multiple interface declarations, as long as they are identical. In the fullscreen API example above, tsc should not fire errors. Optional compiling warnings are acceptable, to assist developers to remove redundant codes at convenient time.\r\n\r\n* Make `lib.d.ts` overridable. When tsc find conflictions between `lib.d.ts` and client codes, it should pickup declarations in client codes. This is because declarations `lib.d.ts` may contain bugs, developers should be allowed  to workaround them. E.g. `MutationObserver`'s constructor was missing a parameter for a long time. Again, optional warnings are welcomed.\r\n\r\nWhat do you think?\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/167834181","html_url":"https://github.com/Microsoft/TypeScript/issues/3215#issuecomment-167834181","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3215","id":167834181,"user":{"login":"markdrake","id":571325,"avatar_url":"https://avatars.githubusercontent.com/u/571325?v=3","gravatar_id":"","url":"https://api.github.com/users/markdrake","html_url":"https://github.com/markdrake","followers_url":"https://api.github.com/users/markdrake/followers","following_url":"https://api.github.com/users/markdrake/following{/other_user}","gists_url":"https://api.github.com/users/markdrake/gists{/gist_id}","starred_url":"https://api.github.com/users/markdrake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdrake/subscriptions","organizations_url":"https://api.github.com/users/markdrake/orgs","repos_url":"https://api.github.com/users/markdrake/repos","events_url":"https://api.github.com/users/markdrake/events{/privacy}","received_events_url":"https://api.github.com/users/markdrake/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T17:20:48Z","updated_at":"2015-12-29T17:20:48Z","body":"We have the same issue, angular 2 just won't compile to ES6 without duplicated declaration issues, if we use the --nolib option we get missing declarations issues. Angular 2 decided to don't address this problem but rather delegate to typescript for the solution, it's an extreme pain, what can we do other than manually editing source files which is not viable in the long term?"}}