Creating TypeScript Declaration Files

and Contributing to DefinitelyTyped

or

What to Do

When TypeScript goes wrong

a picture of me

Joe Skeen

Intermountain Healthcare

Currently in top 100 contributor to DefinitelyTyped (of over 2300)

TypeScript Usually Just Works

Once you get it set up

Cases Where Typings May Be Wrong

  • Typings are wrong (contradict the documentation)
  • Typings are incomplete (missing documented functionality or options)
  • Typings aren't exposing something you need (like an options interface)
  • No typings exist

Examples

Incorrect

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/6156/files

Incomplete

https://github.com/ivogabe/gulp-typescript#options
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#new---skiplibcheck

Not Exposed

https://github.com/klei/gulp-inject

Nonexistant

https://github.com/miickel/gulp-angular-templatecache

How to Fix This

  1. Identify the source of the error
  2. Fix it
  3. Submit pull request(s)

DefinitelyTyped

A great example of an open-source community

How to contribute

  1. Log into GitHub (or create an account)
  2. Fork DefinitelyTyped and clone
  3. Make fixes
  4. Write tests
  5. Test the fixes with npm test
  6. Push your changes to the fork
  7. Set up Travis build https://travis-ci.org/
  8. Open a pull request
DefinitelyTyped Contribution Guide

Let's do this!

Add an option to the gulp-typescript option

https://github.com/ivogabe/gulp-typescript#options
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#new---skiplibcheck

Expose Options interface on gulp-inject

https://github.com/klei/gulp-inject

Create definitions for gulp-angular-templatecache

https://github.com/miickel/gulp-angular-templatecache

If at first you don't succeed...

Now it's your turn!

https://joeskeen.github.io/dts-OpenWest2016   Slides: joeskeen.github.io/dts-OpenWest2016
Review this talk: https://joind.in/talk/bf5d7   https://joind.in/talk/bf5d7

More Resources

OpenWest logo

OpenWest Conference 2016
July 13-16 2016
South Towne Expo Center