Skip to content

The TypeScript Definition Manager **Breaking Changes in 1.0 - see below**

License

Notifications You must be signed in to change notification settings

jonnysmith1981/typings

 
 

Repository files navigation

Typings

NPM version NPM downloads Build status Gitter

The TypeScript Definition Manager.

Updating From 0.x to 1.0?

  • rm -rf typings/
    • The directory contains "main", by default
    • Update tsconfig.json to match (the bundle file is typings/index.d.ts)
  • Want main and/or browser output again? See where the typings install in the FAQ
  • Usages of ambient are now global
    • That means in typings.json any ambientDependencies should be renamed globalDependencies and any ambientDevDependencies should be renamed globalDevDependencies.
    • It also means --ambient is now --global
  • Removed defaultAmbientSource
    • If you want to install from DefinitelyTyped, be explicit (use dt~<pkg> --global). For example: typings install dt~angular-component-router --global --save
  • See the release notes for more information!

Quick Start

# 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-global typings (defaults to "npm" source, configurable through `defaultSource` in `.typingsrc`).
typings install debug --save

# If you use the package through script tag, or
# it is part of the environment, or
# the non-global typings is not yet available:
typings install dt~mocha --global --save

# Install typings from particular registry.
typings install env~atom --global --save
typings install npm~bluebird --save

# Use `typings/index.d.ts` (in `tsconfig.json` or as a `///` reference).
cat typings/index.d.ts

Usage

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.

Read More

Sources

  • npm - dependencies from NPM
  • github - dependencies directly from GitHub (E.g. Duo, JSPM)
  • bower - dependencies from Bower
  • common - "standard" libraries without a known "source"
  • shared - shared library functionality
  • lib - shared environment functionality (mirror of shared) (--global)
  • env - environments (E.g. atom, electron) (--global)
  • global - global (window.<var>) libraries (--global)
  • dt - typings from DefinitelyTyped (usually --global)

Contributing

# 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

License

MIT

About

The TypeScript Definition Manager **Breaking Changes in 1.0 - see below**

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 67.5%
  • TypeScript 32.5%