{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26049","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26049/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26049/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26049/events","html_url":"https://github.com/Microsoft/TypeScript/issues/26049","id":345541346,"node_id":"MDU6SXNzdWUzNDU1NDEzNDY=","number":26049,"title":"Can't refer to JSDoc @enum as a type using `import(\"...\")` syntax","user":{"login":"tschaub","id":41094,"node_id":"MDQ6VXNlcjQxMDk0","avatar_url":"https://avatars0.githubusercontent.com/u/41094?v=4","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"node_id":"MDU6TGFiZWwxMTM5NzAzNjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":114001888,"node_id":"MDU6TGFiZWwxMTQwMDE4ODg=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false},{"id":263347516,"node_id":"MDU6TGFiZWwyNjMzNDc1MTY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Salsa","name":"Salsa","color":"ff4b20","default":false},{"id":869722780,"node_id":"MDU6TGFiZWw4Njk3MjI3ODA=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/checkJs","name":"checkJs","color":"3074a5","default":false}],"state":"closed","locked":false,"assignee":{"login":"sandersn","id":293473,"node_id":"MDQ6VXNlcjI5MzQ3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/293473?v=4","gravatar_id":"","url":"https://api.github.com/users/sandersn","html_url":"https://github.com/sandersn","followers_url":"https://api.github.com/users/sandersn/followers","following_url":"https://api.github.com/users/sandersn/following{/other_user}","gists_url":"https://api.github.com/users/sandersn/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersn/subscriptions","organizations_url":"https://api.github.com/users/sandersn/orgs","repos_url":"https://api.github.com/users/sandersn/repos","events_url":"https://api.github.com/users/sandersn/events{/privacy}","received_events_url":"https://api.github.com/users/sandersn/received_events","type":"User","site_admin":false},"assignees":[{"login":"sandersn","id":293473,"node_id":"MDQ6VXNlcjI5MzQ3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/293473?v=4","gravatar_id":"","url":"https://api.github.com/users/sandersn","html_url":"https://github.com/sandersn","followers_url":"https://api.github.com/users/sandersn/followers","following_url":"https://api.github.com/users/sandersn/following{/other_user}","gists_url":"https://api.github.com/users/sandersn/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersn/subscriptions","organizations_url":"https://api.github.com/users/sandersn/orgs","repos_url":"https://api.github.com/users/sandersn/repos","events_url":"https://api.github.com/users/sandersn/events{/privacy}","received_events_url":"https://api.github.com/users/sandersn/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74","html_url":"https://github.com/Microsoft/TypeScript/milestone/74","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/74/labels","id":3468190,"node_id":"MDk6TWlsZXN0b25lMzQ2ODE5MA==","number":74,"title":"TypeScript 3.1","description":"","creator":{"login":"mhegazy","id":8000722,"node_id":"MDQ6VXNlcjgwMDA3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","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},"open_issues":231,"closed_issues":62,"state":"open","created_at":"2018-07-02T19:25:46Z","updated_at":"2018-07-31T18:07:07Z","due_on":"2018-09-17T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-07-29T15:54:07Z","updated_at":"2018-07-31T18:07:07Z","closed_at":"2018-07-31T18:07:06Z","author_association":"CONTRIBUTOR","body":"**TypeScript Version:**  `built/local/tsc.js` as of 092377160674180a6371d0a2c430b7574d7aaff5\r\n\r\nI'm having trouble importing a type annotated with a JSDoc `@enum` tag (using the new functionality added in #26021).\r\n\r\n**Search Terms:**\r\n\r\n * JSDoc\r\n * enum\r\n * import\r\n\r\n**Code**\r\n\r\nIn `check/main.js`:\r\n```js\r\n/**\r\n * @param {import(\"./TestEnum.js\").default} type The type.\r\n * @returns {string} The type.\r\n */\r\nfunction check(type) {\r\n  return type;\r\n}\r\n```\r\n\r\nIn `check/TestEnum.js`:\r\n```js\r\n/**\r\n * @enum {string}\r\n */\r\nexport default {\r\n  ADD: 'add',\r\n  REMOVE: 'remove'\r\n};\r\n```\r\n\r\nIn `check/tsconfig.json`:\r\n```json\r\n{\r\n  \"compilerOptions\": {\r\n    \"allowJs\": true,\r\n    \"checkJs\": true,\r\n    \"noEmit\": true,\r\n    \"strict\": false\r\n  },\r\n  \"include\": [\r\n    \"*.js\"\r\n  ]\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\n`node ../built/local/tsc.js --pretty` exits with `0`\r\n\r\n**Actual behavior:**\r\n\r\n```\r\n$ node ../built/local/tsc.js --pretty\r\nmain.js:4:36 - error TS2694: Namespace '\"/Users/tschaub/projects/TypeScript/check/TestEnum\"' has no exported member 'default'.\r\n\r\n4  * @param {import(\"./TestEnum.js\").default} type The type.\r\n                                     ~~~~~~~\r\n```\r\n\r\n**Other things I've tried:**\r\n\r\nI tried using different syntax for the `import` in `main.js` (e.g. removing `.default`).  I tried declaring the enum and using an identifier in the default export statement (e.g. `export default TestEnum`).  I tried using a named export in the other module (e.g. `export const TestEnum = {/** ... */}`).\r\n\r\nThings do work if I declare the `@enum` in the same module where it is used.  I.e. this works:\r\n```js\r\n\r\n/**\r\n * @enum {string}\r\n */\r\nexport const TestEnum = {\r\n  ADD: 'add',\r\n  REMOVE: 'remove'\r\n};\r\n\r\n\r\n/**\r\n * @param {TestEnum} type The type.\r\n * @returns {string} The type.\r\n */\r\nfunction check(type) {\r\n  return type;\r\n}\r\n```"}}
{"actor":{"display_login":"sandersn"}}