Title: TypeScript definition files
Tags: typescript;definitions
Question: I'm playing with TypesScript, but the compiler complains when I use browser types such as HTMLCanvasElement. I guess I need definition files for these types.
I bet there is a repository of definition files for the DOM and for most popular frameworks, but Google has not been able to help me find it.

Do you guys know of such a repository?


Here is the accepted answer: The ```lib.d.ts``` that is included in the source (http://typescript.codeplex.com/SourceControl/changeset/view/fe3bc0bfce1f#bin%2flib.d.ts) contains definitions for most of the DOM related stuff. If you are using Visual Studio, you should consider downloading the tools which includes a template where ```lib.d.ts``` is bundled.

If anything is missing, I think you can use the ```declare``` syntax. 

Comment for this answer: This looks like what I were looking for. Thanks.
Comment for this answer: you can look at http://www.tsdpm.com/ and https://github.com/Diullei/tsd#readme too.

Here is another answer: In addition to what @Christoffer has said for the DOM, @Boris Yankov has a really useful repository here: https://github.com/borisyankov/DefinitelyTyped with definition files for more than thirty, one hundred and thirty close to two hundred libraries(and counting!).

There's even a manager for the type definition files now: http://definitelytyped.org/tsd/ (Do not follow: link is now NSFW spam)

AND: Quite a lot of definition files are now on nuget: http://www.nuget.org/packages?q=TypeScript

Comment for this answer: @JcFx Do you know of any plugin or Grunt task that can create definitions for newly created, local typescript files? E.g. I have a *_definitions.ts* file that contains all my definitions (local and plugins e.g. AngularJS). This file then gets referenced from every other .ts file. It would be great if something could update *_definitions.ts* with every new typescript file I create, automatically.
Comment for this answer: We may need to update the link for type definition file manager. It redirects to something completely different now.
Comment for this answer: That looks very useful indeed. Thanks for the link.
Comment for this answer: TSD has been deprecated in favor of Typings now: https://github.com/typings/typings/blob/master/docs/tsd.md

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:10/29/12', 'FavoriteCount': 4.0, 'PostTypeId': 1, 'Tags': '<typescript><definitions>', 'Title': 'TypeScript definition files', 'ViewCount': 11270, 'id': 13118051, 'user_AboutMe': None, 'user_AccountId': 452343.0, 'user_DisplayName': 'Robert Larsen', 'user_Reputation': 928.0, 'user_Views': 106.0, 'user_id': 1278300.0}}