Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a typescript definition file for google closure library?

I'd like to use google's closure library in my typescript based environment and I wonder if there is an existing type definition file for the library?

I know that there is a converter for the opposite (i.e. a converter from typescript to closure) here but I'd like to stay in typescript environment.

I'll probably start defining modules/methods that I use in a type definition file and update the file as I go but obviously it would be much better if there is an existing file already.

like image 290
nrydn Avatar asked Jan 05 '14 02:01

nrydn


3 Answers

The definitive source for TypeScript definitions is https://github.com/borisyankov/DefinitelyTyped and considering its not there I suspect no one has gotten around to creating a type definition for Google Closure Library.

like image 59
basarat Avatar answered Jan 01 '23 12:01

basarat


See Github: Closure Library declaration files for TypeScript

Also, see this alternative to bolinfest's TypeScript fork: Github: typescript-closure-compiler

like image 40
mesteiral Avatar answered Jan 01 '23 12:01

mesteiral


The Angular team has starting working on a tool to use the Closure Library JSDocs to create .d.ts files. It will still be up to you to use the tool to generate the type definitions.

https://github.com/angular/clutz

That library also include the Gents tool though, which converts goog.module and goog.require modules into TS-type modules. Seems like it would be worth it for someone to generate those types and contribute them to DefinitelyTyped for others to use.

EDIT: This library seems to be aimed at processing existing projects that have Closure's JSDoc-style annotations. Rather than being used on the Closure Library itself.

like image 42
KenneyE Avatar answered Jan 01 '23 11:01

KenneyE