{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3832","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3832/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3832/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3832/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3832","id":94600943,"number":3832,"title":"Aliasing enums","user":{"login":"AlicanC","id":412180,"avatar_url":"https://avatars.githubusercontent.com/u/412180?v=3","gravatar_id":"","url":"https://api.github.com/users/AlicanC","html_url":"https://github.com/AlicanC","followers_url":"https://api.github.com/users/AlicanC/followers","following_url":"https://api.github.com/users/AlicanC/following{/other_user}","gists_url":"https://api.github.com/users/AlicanC/gists{/gist_id}","starred_url":"https://api.github.com/users/AlicanC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlicanC/subscriptions","organizations_url":"https://api.github.com/users/AlicanC/orgs","repos_url":"https://api.github.com/users/AlicanC/repos","events_url":"https://api.github.com/users/AlicanC/events{/privacy}","received_events_url":"https://api.github.com/users/AlicanC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-12T21:31:06Z","updated_at":"2015-07-13T19:04:25Z","closed_at":null,"body":"I have a few files for making HTTP requests. I want to extend those to allow easier access to our API. Here is some sample code:\r\n\r\nhttp.ts\r\n```typescript\r\nexport type HTTPParameters = { [key: string]: string };\r\nexport type HTTPHeaders = { [key: string]: string };\r\nexport enum HTTPMethod { Get, Head, Post, Put, ... };\r\n```\r\n\r\napi.ts (->Arrows<- point out where the errors are.)\r\n```typescript\r\nimport { HTTPParameters, HTTPHeaders, HTTPMethod } from './http.ts';\r\n\r\nexport type ApiParameters = HTTPParameters;\r\nexport type ApiHeaders = HTTPHeaders;\r\n\r\n/* Try one */\r\nexport type ApiMethod = HTTPMethod;\r\n\r\nexport class Foo {\r\n  constructor(public method: ApiRequestMethod = ->ApiRequestMethod<-.Get) {}\r\n  // Cannot find name 'ApiRequestMethod'\r\n}\r\n\r\n/* Try two */\r\nexport var ApiMethod = HTTPMethod;\r\n\r\nexport class Foo {\r\n  constructor(public method: ->ApiRequestMethod<- = ApiRequestMethod.Get) {}\r\n  // Cannot find name 'ApiRequestMethod'\r\n}\r\n\r\n/* Try three */\r\nexport enum ApiRequestMethod ->=<- HTTPRequestMethod;\r\n// Expected '{'\r\n\r\n/* Try four */\r\nexport enum ApiRequestMethod ->HTTPRequestMethod<-;\r\n// Expected '{'\r\n```\r\n\r\nThe actual working solution looks like this:\r\n```typescript\r\nimport { SomeEnum as MyEnum } from './http.ts';\r\n\r\nexport { MyEnum };\r\n\r\nexport class Foo {\r\n  constructor(public method: MyEnum = MyEnum.Get) {}\r\n}\r\n```\r\n\r\nI might be missing something here, but if this is really the only solution, then it's pretty ugly and it would be nice to have something better."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/121024254","html_url":"https://github.com/Microsoft/TypeScript/issues/3832#issuecomment-121024254","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3832","id":121024254,"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-07-13T19:04:25Z","updated_at":"2015-07-13T19:04:25Z","body":"why not just use `import"}}