The TypeScript Definition Manager.
Updating from 0.6 to 0.7? Make sure you rm -rf typings/
and re-install them, the directory structure has changed.
# Install Typings CLI utility.
npm install typings --global
# Search for definitions.
typings search tape
# Find an available definition (by name).
typings search --name react
# If you use the package as a module:
# Install non-ambient typings (default from "npm" registry, configurable through `defaultSource` in `.typingsrc`)
typings install chai --save
# If you use the package through script tag, or
# it is part of the environment, or
# the non-ambient typings is not yet available:
# Install ambient typings (default from "DT", configurable through `defaultAmbientSource` in `.typingsrc`)
typings install mocha --ambient --save
# Install typings from particular registry
typings install env!atom --ambient --save
typings install npm!bluebird --save
# Use `main.d.ts` (in `tsconfig.json` or as a `///` reference).
cat typings/main.d.ts
Typings is the simple way to manage and install TypeScript definitions. It uses typings.json
, which can resolve to the Typings Registry, GitHub, NPM, Bower, HTTP and local files. Packages can use type definitions from various sources and different versions, knowing they will never conflict for users.
typings install debug --save
The public registry is maintained by the community, and is used to resolve official type definitions for JavaScript packages.
npm
- dependencies from NPMgithub
- dependencies directly from GitHub (E.g. Duo, JSPM)bower
- dependencies from Bowercommon
- "standard" libraries without a known "source"shared
- shared library functionalitylib
- shared environment functionality (mirror ofshared
) (--ambient
)env
- environments (E.g.atom
,electron
) (--ambient
)global
- global (window.<var>
) libraries (--ambient
)dt
- typings from DefinitelyTyped (usually--ambient
)
# Installation
# Fork this repo (https://github.com/typings/typings)
# Clone the fork (E.g. `https://github.com/<your_username>/typings.git`)
cd typings
# Install modules
npm install
# Build
npm run build
# Test
npm run test
MIT