Title: [transpileDeclaration API][5.5] More missing type-only imports · Issue #58511 · microsoft/TypeScript · GitHub
Open Graph Title: [transpileDeclaration API][5.5] More missing type-only imports · Issue #58511 · microsoft/TypeScript
X Title: [transpileDeclaration API][5.5] More missing type-only imports · Issue #58511 · microsoft/TypeScript
Description: 🔎 Search Terms transpiledeclaration api emit missing import 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.typescriptlang.org/dev/bug-workbench/?target=7&ts...
Open Graph Description: 🔎 Search Terms transpiledeclaration api emit missing import 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.typescrip...
X Description: 🔎 Search Terms transpiledeclaration api emit missing import 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.types...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58511
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[transpileDeclaration API][5.5] More missing type-only imports","articleBody":"### 🔎 Search Terms\n\ntranspiledeclaration api emit missing import\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR https://github.com/microsoft/TypeScript/pull/58261 @weswigham \r\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/dev/bug-workbench/?target=7&ts=5.5.0-dev.20240512#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU13ygAsaB3AUQFt5o8YNp179oWAgDF4JLGjIA6AguiRBESO259o4qTLmgARkpVr14AGYG6ZHocWqcWAB4AHGrGih4dcbEsyRCxQAEk6UABvHFBQAG0AaywATzQYBDoAcwBdNAw6BLpOOgBuHABfZ3dPb19-QODQAHkMb2jYxJS0uF8cvIKijlKKqo8vdGS3EIAhMkgQgF5QAHIyZdAAHxWjZbKLa1lbezQTJ3geMbaJqbC6ABprkJboB+hJmbmQ8tBLWBoeUAAIgUwDIgL2rkuoEQ9BgoBoRgAVsRvEt2qACDQACqsXoAHixoFc4joBEgoFm8wAfAAKAD6qFAWIedN8aHCcSx2QAlGhnpzslEYrFQLAsNAMLBhrFyncKmUgA\n\n### 💻 Code\n\n```ts\r\n// @strict: true\r\n// @declaration: true\r\n// @showEmit\r\n// @showEmittedFile: a.d.ts\r\n// @showEmittedFile: b.d.ts\r\n\r\n// @filename: a.ts\r\nexport interface In {\r\n [key: string]: unknown;\r\n}\r\nexport interface Out {\r\n [key: string]: unknown;\r\n}\r\nexport type Base = 'a' | 'b';\r\n\r\n// @filename: b.ts\r\nimport { type In, type Out, type Base } from \"./a\";\r\n\r\nexport const object = {\r\n doThing\u003cT extends Base>(_t: T, _in: In[T]): Out[T] {\r\n return;\r\n },\r\n};\r\n```\r\n\n\n### 🙁 Actual behavior\n\nWhen using the API, `b.d.ts` is emitted as\r\n```ts\r\nimport { type In } from \"./a\";\r\nexport declare const object: {\r\n doThing\u003cT extends Base>(_t: T, _in: In[T]): Out;\r\n};\r\n```\r\nwhile when using `tsc` it gets emitted as\r\n```ts\r\nimport { type In, type Out, type Base } from \"./a\";\r\nexport declare const object: {\r\n doThing\u003cT extends Base>(_t: T, _in: In[T]): Out[T];\r\n};\r\n```\r\n(interestingly the Debug tab of the workbench link shows something that's partially wrong)\n\n### 🙂 Expected behavior\n\nUsing the API should emit\r\n```ts\r\nimport { type In, type Out, type Base } from \"./a\";\r\nexport declare const object: {\r\n doThing\u003cT extends Base>(_t: T, _in: In[T]): Out[T];\r\n};\r\n```\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/MichaelMitchell-at","@type":"Person","name":"MichaelMitchell-at"},"datePublished":"2024-05-13T04:56:08Z","url":"https://github.com/microsoft/TypeScript/issues/58511"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e84324bf-c369-536f-ed4a-d0fae9715239 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A918:34DB8F:2DC8F61:3D39E8F:6B01E21C |
| html-safe-nonce | 68a6cadf3ba857aba7240e82421961d29a4a9828e672258d09cb33207bf03c03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTE4OjM0REI4RjoyREM4RjYxOjNEMzlFOEY6NkIwMUUyMUMiLCJ2aXNpdG9yX2lkIjoiNjE2ODEyODg4NDkyODc5OTI2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a14aa0b0984709b388c6159fa70bb03d0f211893bc36c097668bfe6a481f45cd |
| hovercard-subject-tag | issue:2291820915 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/58511/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4cf469f291779eb24ac26e6ad592275e101aa3cac32a1266c485ef2fefa29a2c/microsoft/TypeScript/issues/58511 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4cf469f291779eb24ac26e6ad592275e101aa3cac32a1266c485ef2fefa29a2c/microsoft/TypeScript/issues/58511 |
| og:image:alt | 🔎 Search Terms transpiledeclaration api emit missing import 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.typescrip... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MichaelMitchell-at |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width