Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

ts-expose-internals

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-expose-internals

Augment the TypeScript compiler module's types to expose hidden internal types

latest
Source
npmnpm
Version
5.6.3
Version published
Weekly downloads
4.9K
11.09%
Maintainers
1
Weekly downloads
 
Created
Source

License

TypeScript Internal Types

Expose TypeScript internal types by simply adding a development dependency.

Setup

  • Add aliased dependency to package.json (use the same version as your typescript version)

    {
      "devDependencies": {
        "typescript": "^5.1.3",
        // Note: The package is 'ts-expose-internals', but we are aliasing within the @types scope to make TS adopt it globally
        "@types/ts-expose-internals": "npm:ts-expose-internals@5.1.3"
      }
    }
    
  • Run npm install / yarn install

Usage

All internal types are now available within the primary typescript module

// This namespace is flagged @internal and is omitted from published types, but now we can access it!
import { JsDoc } from 'typescript'

How It Works

The code within this repo runs on a schedule of once per day via GitHub Actions.

It checks for new TypeScript release tags, and if there are any, it clones the source code for that release and builds the internal types. After, it performs a bit of transformation magic and publishes the package to NPM.

New types are added to the 'typescript' module via the Module Augmentation technique.

Notes

  • We publish for full TS releases only. If you'd like nightly builds, have a look at byots.
  • If we don't have a package for the latest release, please allow 24hrs, then file an issue.

Acknowledgments

Thanks to basarat for his work on byots, which served as the inspiration!

Keywords

typescript

FAQs

Package last updated on 10 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts