-
Notifications
You must be signed in to change notification settings - Fork 0
How to contribute
To ensure the quality of DefinitelyTyped repository, the typings must meet the following criteria:
-
Definition files should be called
library.d.ts. In case there are multiple versions supported, the latest one will be without a version number in the file name. Older versions will be in the form oflibrary-1.0.d.ts. -
The typing must have a header with the following format:
// Type definitions for [LIBRARY NAME]
// Project: [LIBRARY URL]
// Definitions by: [AUTHOR NAME] <[AUTHOR URL]>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
Example:
// Type definitions for Backbone 0.9.10
// Project: http://backbonejs.org/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
- The typing must be placed in a folder. The folder name must be similar to library name.
Example:
qunit.d.tsin in a folder namedqunit
-
Take advantage of TypeScript JSDoc support.
-
The typing must have tests. These tests must be in a files called
library-tests.ts. They are not runnable, in the TDD way. They contain code that should compile with no errors, usually taken from the documentation samples of the library.
Example:
backbone.d.tshave a test file namedbackbone-tests.tsHere you can see a real test file.
- Be careful to use a module to avoid conflicts to your internal interfaces and the interfaces from another typings.
The
jQuery.bbqtyping has the interfaces in a module namedJQueryBbqExample:
module JQueryBbq {
interface JQuery {
\\...
}
\\...
}
interface JQueryStatic {
bbq: JQueryBbq.JQuery;
\\...
}
- Update the README file to put a reference to your definition with the following style:
* [LIBRARY NAME WITH LINK] (by [AUTHOR NAME WITH LINK])
Example:
Thanks for contributing!