Typings
The manager for TypeScript definitions.
Updating from 0.6 to 0.7? Make sure you rm -rf typings/
and re-install them, the directory structure has changed.
Quick Start
npm install typings --global
typings search tape
typings search --name react
typings install react --ambient --save
cat typings/main.d.ts
Features
- Package manager parity
- Familiar commands like
init
, install
, rm
and ls
- Support for installation of type definitions based on the true version number of the package you are using. (Rather than on a SHA hash as with TSD.) Read more.
- Installation from GitHub, BitBucket, NPM dependencies, Bower dependencies and HTTP(s)
- If a project uses Typings, you can install it locally - try
typings install npm:popsicle
- Simple typings configuration file
- Persist dependencies in
typings.json
and everyone on the project can replicate it
- Name-spaced dependencies (not for ambient dependencies - those are always global)
- TypeScript definitions will be name-spaced and contained from leaky type information
Usage
Typings is the simple way to manage and install TypeScript definitions. It uses typings.json
, which can resolve to GitHub, NPM, Bower, HTTP and local files. Packages can use type definitions from various sources and different versions, and know they will never cause a conflict for users.
typings install debug --save
A public registry is maintained by the community, and is used to resolve official type definitions for JavaScript packages.
Read More
Configuration
Typings supports configuration using rc
. The config options can be set using CLI arguments, environment variables prefixed with typings_
or a .typingsrc
file.
- proxy A HTTP(s) proxy URI for outgoing requests
- httpProxy The proxy to use for HTTP requests (default:
process.env.HTTP_PROXY
) - httpsProxy The proxy to use for HTTPS requests (default:
process.env.HTTPS_PROXY
) - noProxy A string of space-separated hosts to not proxy (default:
process.env.NO_PROXY
) - rejectUnauthorized Reject invalid SSL certificates (default:
true
) - ca A string or array of strings of trusted certificates in PEM format
- key Private key to use for SSL (default:
null
) - cert Public x509 certificate to use (default:
null
) - userAgent Set the
User-Agent
for HTTP requests (default: typings/{typingsVersion} node/{nodeVersion} {platform} {arch}
) - githubToken Set your GitHub for resolving
github:
locations - registryURL Override the registry URL
- defaultSource Override the default installation source (E.g. when doing
typings install debug
) (default: npm
) - defaultAmbientSource Override the default ambient installation source (E.g. when doing
typings install node -A
) (default: dt
)
Contributing
cd typings
npm install
npm run build
npm run test
License
MIT