Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Added folder for custom typings
Browse files Browse the repository at this point in the history
  • Loading branch information
dsebastien committed Feb 5, 2016
1 parent f1713f2 commit 37f17fc
Show file tree
Hide file tree
Showing 3 changed files with 442 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/typings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This folder should only contain custom TypeScript type definitions (.d.ts) files.

Only place your own type definitions here or ones that you must temporarily copy/modify.
Unless you have no choice, you should install type definitions using `typings install ... --save`.

If you install typings using the command above:
* typings.json will be updated
* the typings will be downloaded in the root typings folder (i.e., not this one)
* references to these typings files will be added to both `main.d.ts` and `browser.d.ts` in the root typings folder

All type definition files in this folder will automatically be picked up by the TypeScript compiler.

For more details about the typings CLI, check out the official docs: https://github.com/typings/typings
32 changes: 32 additions & 0 deletions src/typings/custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Custom Type Definitions
* When including 3rd party modules you also need to include the type definition for the module
* if they don't provide one within the module. You can try to install it with typings
typings install node --save
* If you can't find the type definition in the registry we can make an ambient definition in
* this file for now. For example
declare module "my-module" {
export function doesSomething(value: string): string;
}
*
* If you're prototying and you will fix the types later you can also declare it as type any
*
declare var assert: any;
*
* If you're importing a module that uses Node.js modules which are CommonJS you need to import as
*
import * as _ from 'lodash'
* You can include your type definitions in this file until you create one for the typings registry
* see https://github.com/typings/registry
*
*/

/// <reference path="custom/require.d.ts" />
Loading

0 comments on commit 37f17fc

Please sign in to comment.