{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5574","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5574/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5574/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5574/events","html_url":"https://github.com/Microsoft/TypeScript/issues/5574","id":115935897,"number":5574,"title":"default import not working","user":{"login":"ntilwalli","id":8410254,"avatar_url":"https://avatars.githubusercontent.com/u/8410254?v=3","gravatar_id":"","url":"https://api.github.com/users/ntilwalli","html_url":"https://github.com/ntilwalli","followers_url":"https://api.github.com/users/ntilwalli/followers","following_url":"https://api.github.com/users/ntilwalli/following{/other_user}","gists_url":"https://api.github.com/users/ntilwalli/gists{/gist_id}","starred_url":"https://api.github.com/users/ntilwalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntilwalli/subscriptions","organizations_url":"https://api.github.com/users/ntilwalli/orgs","repos_url":"https://api.github.com/users/ntilwalli/repos","events_url":"https://api.github.com/users/ntilwalli/events{/privacy}","received_events_url":"https://api.github.com/users/ntilwalli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-09T18:26:11Z","updated_at":"2015-11-09T18:40:45Z","closed_at":null,"body":"When using a default export in one of my declaration files and default import in my source file, I see this error from the compiler:`proxyData.ts(4,12): error TS2304: Cannot find name 'MockServer'.`\r\n\r\nMy declaration file `server.d.ts` looks like this:\r\n```\r\ninterface Server_Static {\r\n  new(url: string): Server_Instance\r\n  of(url: string): Server_Instance\r\n}\r\n\r\ninterface Server_Instance extends EventTarget {\r\n  on(type, callback): any\r\n  send(data, options?): any\r\n  emit(event, data, options?): any\r\n  close(options:any): any\r\n  clients(): any\r\n  to(room): any\r\n}\r\n\r\ndeclare var Server: Server_Static\r\nexport default Server\r\n```\r\n\r\nMy source file looks like this: \r\n```\r\nimport MockServer from './resources/mock-socket/server'\r\n\r\nexport class ProxyData {\r\n  servers: MockServer[]\r\n  constructor(actualWS: WebSocket) {\r\n    this.servers = []\r\n  }\r\n}\r\n```\r\n\r\nI'm using typescript@next, 1.8.0-dev.20151107\r\n\r\nAny ideas?  The replication code is uploaded to http://github.com/ntilwalli/tsDefaultIssue\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/155150806","html_url":"https://github.com/Microsoft/TypeScript/issues/5574#issuecomment-155150806","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5574","id":155150806,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T18:40:45Z","updated_at":"2015-11-09T18:40:45Z","body":"then you need to export both:\r\n\r\n```ts\r\ninterface Server_Static {\r\n    new (url: string): Server;\r\n    of(url: string): Server;\r\n}\r\n\r\ninterface Server extends EventTarget {\r\n    on(type, callback): any;\r\n    send(data, options?): any;\r\n    emit(event, data, options?): any;\r\n    close(options: any): any;\r\n    clients(): any;\r\n    to(room): any;\r\n}\r\n\r\ndeclare var Server: Server_Static;\r\n\r\n// Export both variable Server and interface Server\r\nexport default Server;\r\n```"}}