{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2062","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2062/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2062/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2062/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2062","id":58057795,"number":2062,"title":"When creating external module, you need to declare your interfaces twice. How to avoid it?","user":{"login":"Brentamil","id":6246343,"avatar_url":"https://avatars.githubusercontent.com/u/6246343?v=3","gravatar_id":"","url":"https://api.github.com/users/Brentamil","html_url":"https://github.com/Brentamil","followers_url":"https://api.github.com/users/Brentamil/followers","following_url":"https://api.github.com/users/Brentamil/following{/other_user}","gists_url":"https://api.github.com/users/Brentamil/gists{/gist_id}","starred_url":"https://api.github.com/users/Brentamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brentamil/subscriptions","organizations_url":"https://api.github.com/users/Brentamil/orgs","repos_url":"https://api.github.com/users/Brentamil/repos","events_url":"https://api.github.com/users/Brentamil/events{/privacy}","received_events_url":"https://api.github.com/users/Brentamil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T11:44:33Z","updated_at":"2015-02-18T11:46:48Z","closed_at":null,"body":"I am using AMD modules and need to define JQuery Plugins. Here is a sample code:\r\n```javascript\r\n// file: plugin.ts\r\nexport interface plugin_option {\r\n    c1?: C1;\r\n    c2?: C2;\r\n    cn?: Cn;\r\n}\r\nexport class C1 { }\r\nexport class C2 { }\r\nexport class Cn { }\r\n\r\n$.fn.plugin = function (option?: plugin_option) {\r\n}\r\n\r\n// file: plugin.d.ts\r\ndeclare module plugin {\r\n    interface plugin_option {\r\n        c1?: C1;\r\n        c2?: C2;\r\n        cn?: Cn;\r\n    }\r\n    export class C1 { }\r\n    export class C2 { }\r\n    export class Cn { }\r\n}\r\n\r\ninterface JQuery {\r\n    plugin(option?: plugin.plugin_option);\r\n}\r\n\r\n// file: app.ts\r\n///<reference path=\"Scripts/typings/jquery/jquery.d.ts\" />\r\n////<reference path=\"plugin.d.ts\" />\r\nimport plugin = require(\"plugin\");\r\nwindow.onload = () => {\r\n    $(\"DOMid\").plugin({ c2: new plugin.C2() });\r\n};\r\n```\r\n\r\nIn plugin.ts, I define class C1, C2, Cn & plugin_option.\r\nIn plugin.d.ts, I need to declare everyting a second time into the module \"plugin\".\r\n\r\nIs there a way to avoid this second declaration in plugin.d.ts ?\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/74851786","html_url":"https://github.com/Microsoft/TypeScript/issues/2062#issuecomment-74851786","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2062","id":74851786,"user":{"login":"NoelAbrahams","id":1106823,"avatar_url":"https://avatars.githubusercontent.com/u/1106823?v=3","gravatar_id":"","url":"https://api.github.com/users/NoelAbrahams","html_url":"https://github.com/NoelAbrahams","followers_url":"https://api.github.com/users/NoelAbrahams/followers","following_url":"https://api.github.com/users/NoelAbrahams/following{/other_user}","gists_url":"https://api.github.com/users/NoelAbrahams/gists{/gist_id}","starred_url":"https://api.github.com/users/NoelAbrahams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoelAbrahams/subscriptions","organizations_url":"https://api.github.com/users/NoelAbrahams/orgs","repos_url":"https://api.github.com/users/NoelAbrahams/repos","events_url":"https://api.github.com/users/NoelAbrahams/events{/privacy}","received_events_url":"https://api.github.com/users/NoelAbrahams/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T11:46:48Z","updated_at":"2015-02-18T11:46:48Z","body":"Compiling with \"generate declarations\" set to true should fix that."}}