- Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Description
Bug Report
Hi! We have TypeScript plugin and after recent update to latest TypeScript version to 5.0.2 we no longer can use ts in types in our files e.g.:
// In TS 4.9.5 we could: // File: index.ts import 'typescript/lib/tsserverlibrary' // or ///<ref ... // File: other.ts export const decorateLs = (languageService: ts.LanguageService) => {...}We don't like to rewrite everything to use imports (import('typescript').LanguageService) and we more like the current state of codebase with concise type declarations
🔎 Search Terms
Type import module use globally, define type module globally, declare global type
We tried this workaround:
// File: ts.d.ts type ts = typeof import('typescript') // or declare global { ... } export { }But in other.ts:
type A = ts.LanguageService // Error: 'ts' only refers to a type, but is being used as a namespace here.ts(2702)But I personally have no idea why it doesn't capture module's type into declared type
//cc @zardoy
Metadata
Metadata
Assignees
Labels
No labels