{"id":26511,"library":"ts-expose-internals","title":"ts-expose-internals","description":"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.","status":"active","version":"5.6.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/nonara/ts-expose-internals","tags":["javascript","typescript","internal types","internals","byots","types"],"install":[{"cmd":"npm install ts-expose-internals","lang":"bash","label":"npm"},{"cmd":"yarn add ts-expose-internals","lang":"bash","label":"yarn"},{"cmd":"pnpm add ts-expose-internals","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: must be installed as a devDependency with matching version","package":"typescript","optional":false}],"imports":[{"note":"Types are augmented onto the 'typescript' module, not exported from 'ts-expose-internals'.","wrong":"import { JsDoc } from 'ts-expose-internals'","symbol":"JsDoc (or any internal type)","correct":"import { JsDoc } from 'typescript'"},{"note":"The package only augments types; you still import from 'typescript'. Default import works as usual.","wrong":"import ts from 'ts-expose-internals'","symbol":"Internal types (default import)","correct":"import * as ts from 'typescript'"},{"note":"Augmentation applies to the 'typescript' module regardless of import style.","wrong":"const ts = require('ts-expose-internals')","symbol":"Require (CommonJS)","correct":"const ts = require('typescript')"},{"note":"Type imports must target the original module.","wrong":"import type { JsDoc } from 'ts-expose-internals'","symbol":"Type-only imports","correct":"import type { JsDoc } from 'typescript'"}],"quickstart":{"code":"// 1. Add to package.json:\n// {\n//   \"devDependencies\": {\n//     \"typescript\": \"^5.6.3\",\n//     \"@types/ts-expose-internals\": \"npm:ts-expose-internals@5.6.3\"\n//   }\n// }\n// 2. Run: npm install\n// 3. Now internal types are available:\nimport { JsDoc, Symbol, Type } from 'typescript';\n\nconst doc: JsDoc = { comment: '/** example */', tags: [] };\nconsole.log(doc);","lang":"typescript","description":"Demonstrates installation via aliased dependency and usage of internal type JsDoc from 'typescript'."},"warnings":[{"fix":"Ensure '@types/ts-expose-internals' version matches your 'typescript' version exactly.","message":"Must use exact same version as your typescript dependency. Mismatch causes type errors.","severity":"breaking","affected_versions":"all"},{"fix":"Use byots if you need nightly internal types.","message":"Types only exposed for full releases, not nightly/RC. Use byots for nightly builds.","severity":"gotcha","affected_versions":"all"},{"fix":"Use: npm install --save-dev @types/ts-expose-internals@npm:ts-expose-internals@5.6.3","message":"Package must be installed as an aliased devDependency under '@types/ts-expose-internals'. Installing directly as 'ts-expose-internals' does not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Check TypeScript changelog for internal API changes. This package only regenerates types per release.","message":"As of TypeScript 5.0+, some internal types may have changed or been removed. Not all internal APIs are stable.","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Remove the direct 'ts-expose-internals' install and add '@types/ts-expose-internals': 'npm:ts-expose-internals@<version>' to devDependencies.","cause":"Package installed directly as 'ts-expose-internals' instead of aliased under '@types/ts-expose-internals'.","error":"Cannot find module 'ts-expose-internals' or its corresponding type declarations."},{"fix":"Update both to the same version and reinstall.","cause":"Mismatched versions: '@types/ts-expose-internals' version does not match installed typescript version.","error":"Module augmentation error: 'typescript' has no exported member 'JsDoc'."},{"fix":"Ensure '@types' is in 'types' or 'typeRoots' in tsconfig.json, and that the aliased dependency is correctly added.","cause":"The augmentation file is not being picked up. Possibly missing aliased install or tsconfig does not include node_modules/@types.","error":"Type 'typeof import('/path/to/typescript')' has no property 'JsDoc'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}