TypeScript type definition (d.ts) for Google Closure Library
npm install google-closure-library-types> Closure Library declaration files for TypeScript.
Generated by clutz.
npm i -D closure-library.d.ts and edit tsconfig.json like:
``json`
"baseUrl": "./",
"paths": {
"goog:*": ["./node_modules/closure-library.d.ts/index.d.ts"]
},
then
`ts
import Component from 'goog:goog.ui.Component';
class MyComponent extends Component {
hello(): string {
return 'Hello!';
}
}
`
- See errors.txt
- Worker related files (ex. goog.messaging.*`) are removed because TypeScript cannot support both DOM and Worker.
- Specifying lib: DOM and WebWorker should not be mutually exclusive · Issue \#20595 · Microsoft/TypeScript
MIT License: Teppei Sato