{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10950","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10950/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10950/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10950/events","html_url":"https://github.com/Microsoft/TypeScript/issues/10950","id":177431589,"number":10950,"title":"Question about module augmentation","user":{"login":"hriss95","id":17428714,"avatar_url":"https://avatars.githubusercontent.com/u/17428714?v=3","gravatar_id":"","url":"https://api.github.com/users/hriss95","html_url":"https://github.com/hriss95","followers_url":"https://api.github.com/users/hriss95/followers","following_url":"https://api.github.com/users/hriss95/following{/other_user}","gists_url":"https://api.github.com/users/hriss95/gists{/gist_id}","starred_url":"https://api.github.com/users/hriss95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hriss95/subscriptions","organizations_url":"https://api.github.com/users/hriss95/orgs","repos_url":"https://api.github.com/users/hriss95/repos","events_url":"https://api.github.com/users/hriss95/events{/privacy}","received_events_url":"https://api.github.com/users/hriss95/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-16T13:55:13Z","updated_at":"2016-09-19T18:13:48Z","closed_at":"2016-09-19T18:13:48Z","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  1.8.0 and nightly (2.1.0-dev.20160916)\r\n\r\nHello, I've come across the problem of using a definition from DefinitelyTyped using typings to get the latest version and having to augment a module to add API that the folks at DefinitelyTyped rightfully do not want declare as it is internal. However, the module that they use exports using the `export =` assignment and this causes the compiler to complain and I am not sure if that intended or a bug. \r\nHere is a dummy example to recreate the problem\r\n**Code**\r\n\r\n```ts\r\n// File a.d.ts\r\ndeclare module \"foo\" {\r\n\tfunction internal(a: number): void;\r\n\tnamespace internal {\r\n\t\texport var x: number;\r\n\t\texport function f(x: number, y: number): number;\r\n\t} \r\n\r\n\texport = internal;\r\n}\r\n\r\n// File a-extension.d.ts\r\n\r\n/// <reference path='./a.d.ts' />\r\n\r\ndeclare module \"foo\" {\r\n\tnamespace internal {\r\n\t\texport function f2(x: string): number;\r\n\t}\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nUnless this is intended I would expect for this to compile cleanly and be able to use f2 as a member of the exported namespace\r\n\r\n**Actual behavior:** \r\n\r\n`a.d.ts(8,2): error TS2309: An export assignment cannot be used in a module with other exported elements.`\r\n\r\nSince I want to have the latest version of the definition file I get from DefinitelyTyped I cannot really change anything in that file( `a.d.ts` in the dummy example ) so if there is any other way in which I can do what I want to do with `a-extension.d.ts` please let me know. Thank you in advance for the help :+1: \r\n"}}
{"actor":{"display_login":"mhegazy"}}