Socket
Socket
Sign inDemoInstall

ts-expose-internals

Package Overview
Dependencies
Maintainers
1
Versions
84
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


Version published
Weekly downloads
1K
decreased by-17.91%
Maintainers
1
Weekly downloads
 
Created
Source

Used By License

TypeScript Internal Types

Expose TypeScript internal types by simply adding a development dependency.

Setup

  1. Add dependency to package.json (set version to the same as your typescript version)

     {
       "devDependencies": {
         "typescript": "^3.9.6",
         "ts-expose-internals": "^3.9.6"
       }
     }
    
  2. Run npm install (for yarn: yarn install)

  3. Import the package once in your main index.ts

     import 'ts-expose-internals'
    

    Note:

    You can add this import line in any .ts file that is included in your project.
    It only needs to be added to one file in the project for the types to be recognized.

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

This repository is deployed on a server which runs scripts/cron.sh every 12 hours.

The scripts compare our release tags with the TypeScript compiler's tags. If new versions are detected, it builds the compiler source, with internal types included, and publishes a new release with its types.

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

Notes

  • We publish for 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.
  • We only have types for versions 3.8 and higher. The older builds will not compile. 😢
    • If you'd like an older version's types and can get it to build, let us know how you've configured it, and we'll publish it.

Acknowledgments

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

Keywords

FAQs

Package last updated on 25 Jul 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc