문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

See Github: Closure Library declaration files for TypeScript

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

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top