ts-expose-internals-conditionally

raw JSON →
1.0.0-empty.0 verified Fri May 01 auth: no javascript deprecated

A type augmentation package that conditionally exposes TypeScript compiler internal types when the consuming project's tsconfig.json includes 'ts-expose-internals' in the `customConditions` field. Version 1.0.0-empty.0 is an empty placeholder, effectively doing nothing; there is no stable release with actual functionality. This is a proof-of-concept for conditional type augmentation, not for production use. The package ships with TypeScript type definitions and targets developers working on TypeScript compiler internals or tooling that requires access to hidden APIs.

error Cannot find module 'ts-expose-internals-conditionally' or its corresponding type declarations.
cause Package not installed or version is empty placeholder with no actual module.
fix
Run npm install ts-expose-internals-conditionally@latest (once stable release exists) or use another package.
error Module augmentation failed: 'typescript' does not have any internal types.
cause customConditions in tsconfig.json missing 'ts-expose-internals'.
fix
Add 'customConditions': ['ts-expose-internals'] to compilerOptions in tsconfig.json.
deprecated Package version 1.0.0-empty.0 is an empty placeholder with no functionality. Upgrade to a non-empty version or use alternative packages like 'ts-expose-internals'.
fix Remove this dependency or wait for a future stable release.
gotcha customConditions requires TypeScript 5.0+ and proper configuration in tsconfig.json. Without it, the import has no effect.
fix Ensure tsconfig.json has 'customConditions' array containing 'ts-expose-internals'.
breaking Exposed internal types are unstable and may change between TypeScript versions, breaking your code.
fix Pin your TypeScript version and test after updates.
gotcha This package only provides type augmentation; the actual TypeScript runtime does not export internals. Code using these types will not compile if you try to access them at runtime.
fix Use only for type definitions; do not rely on runtime exports.
deprecated The entire approach of conditionally exposing internals via customConditions is experimental and not officially supported by the TypeScript team.
fix Consider using @ts-expose-internals or forking TypeScript.
npm install ts-expose-internals-conditionally
yarn add ts-expose-internals-conditionally
pnpm add ts-expose-internals-conditionally

Shows how to enable internal types by setting customConditions and importing the package as side-effect.

// tsconfig.json
{
  "compilerOptions": {
    "customConditions": ["ts-expose-internals"]
  }
}

// any.ts (after importing the package)
import 'ts-expose-internals-conditionally';
import ts from 'typescript';
// Now TypeScript's internal types (like `EnumType`) are accessible via `ts`
const internalType: ts.EnumType = { /* ... */ };