Registry / type-stubs / ts-expose-internals

ts-expose-internals

JSON →
library5.6.3jsnpmunverified

Expose TypeScript compiler's hidden @internal types via module augmentation. Current stable version is 5.6.3, released to match TypeScript 5.6.3. Published automatically within 24 hours of each full TypeScript release. Key differentiator: unlike byots (which requires a fork of TypeScript), this package works by augmenting the official 'typescript' module, so you can access internal types like JsDoc, Symbol, etc. directly from 'typescript'. It does not modify runtime behavior, only types. Installation requires an aliased devDependency under @types/ts-expose-internals to ensure global type adoption. Supports ESM and CJS as it simply provides type augmentation.

npm install ts-expose-internals
INSTALL
IMPORT
SIG · TS-EXPOSE-INTERNAL
T
ts-expose-internals
type-stubsjavascriptv5.6.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JsDoc (or any internal type)
import { JsDoc } from 'typescript'
import { JsDoc } from 'ts-expose-internals'
Types are augmented onto the 'typescript' module, not exported from 'ts-expose-internals'.
Internal types (default import)
import * as ts from 'typescript'
import ts from 'ts-expose-internals'
The package only augments types; you still import from 'typescript'. Default import works as usual.
Require (CommonJS)
const ts = require('typescript')
const ts = require('ts-expose-internals')
Augmentation applies to the 'typescript' module regardless of import style.
Type-only imports
import type { JsDoc } from 'typescript'
import type { JsDoc } from 'ts-expose-internals'
Type imports must target the original module.

Demonstrates installation via aliased dependency and usage of internal type JsDoc from 'typescript'.

// 1. Add to package.json: // { // "devDependencies": { // "typescript": "^5.6.3", // "@types/ts-expose-internals": "npm:ts-expose-internals@5.6.3" // } // } // 2. Run: npm install // 3. Now internal types are available: import { JsDoc, Symbol, Type } from 'typescript'; const doc: JsDoc = { comment: '/** example */', tags: [] }; console.log(doc);
Debug
Known issues
breakingMust use exact same version as your typescript dependency. Mismatch causes type errors.
fix
Ensure '@types/ts-expose-internals' version matches your 'typescript' version exactly.
affects: all
gotchaTypes only exposed for full releases, not nightly/RC. Use byots for nightly builds.
fix
Use byots if you need nightly internal types.
affects: all
gotchaPackage must be installed as an aliased devDependency under '@types/ts-expose-internals'. Installing directly as 'ts-expose-internals' does not work.
fix
Use: npm install --save-dev @types/ts-expose-internals@npm:ts-expose-internals@5.6.3
affects: all
deprecatedAs of TypeScript 5.0+, some internal types may have changed or been removed. Not all internal APIs are stable.
fix
Check TypeScript changelog for internal API changes. This package only regenerates types per release.
affects: >=5.0.0
Errors
Common errors & fixes
Cannot find module 'ts-expose-internals' or its corresponding type declarations.
Package installed directly as 'ts-expose-internals' instead of aliased under '@types/ts-expose-internals'.
fix
Remove the direct 'ts-expose-internals' install and add '@types/ts-expose-internals': 'npm:ts-expose-internals@<version>' to devDependencies.
Module augmentation error: 'typescript' has no exported member 'JsDoc'.
Mismatched versions: '@types/ts-expose-internals' version does not match installed typescript version.
fix
Update both to the same version and reinstall.
Type 'typeof import('/path/to/typescript')' has no property 'JsDoc'.
The augmentation file is not being picked up. Possibly missing aliased install or tsconfig does not include node_modules/@types.
fix
Ensure '@types' is in 'types' or 'typeRoots' in tsconfig.json, and that the aliased dependency is correctly added.
Upgrade
Version history
5.6.3latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency: must be installed as a devDependency with matching version
Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
2
Amazon
1
Resources
ts-expose-internals — npm install ts-expose-internals · libregistry