Closure Library for TypeScript
This is all-in-one package to use Closure Library with TypeScript including:
- Latest Closure Library (patched for TypeScript)
- Type declaration files (d.ts) of Closure Library (closure-library.d.ts)
- Bridge utility for zero config usage
Install
$ npm install closure-library.ts
Usage
// Import index.ts to load type information of Closure Library.;// Call register() to enable `goog.requrie()`.closure.register;// Then `googl.require` returns the namespace!;// Type information of Closure Library is available in TypeScript.;q.enqueue10;q.enqueue20;q.enqueue30;; // n = 10, ok!; // Error! "Type 'number' is not assignable to type 'string'."
Once closure-library.ts is registered in the top of your bootstrap file, you don't have to register()
in each dependent file.
License
MIT License: Teppei Sato <teppeis@gmail.com>