In this part you will try out utility for automatic generation of Kotlin JavaScript headers from TypeScript definitions files.
-
Instal ts2kt from npm -
npm install -g ts2kt. This utility can be used to automatically convert TypeScript definitions to kotlin bindings. Some libraries have TypeScript definitions bundled in, while many others can be found in the DefinitelyTyped repo. -
Check
functions/node_modules/firebase-admin/libfor.d.tsfiles. -
Try to convert
index.d.tsto Kotlin:
ts2kt functions/node_modules/firebase-admin/lib/index.d.ts- Examine the generated files.
Auto-generated files are helpful to understand how ts2kt and inter-op works, but unfortunately generated code requires a lot of polishing in most cases.