简体   繁体   English

我可以在javaScript和typeScript中为firebase编写云函数吗?

[英]Can I write cloud functions for firebase both in javaScript and typeScript?

I have already deployed some 4 or 5 functions to firebase using JavaScript. 我已经使用JavaScript将4或5个功能部署到了Firebase。 But now I want to use async-await in my 2 functions. 但是现在我想在我的两个函数中使用async-await。 So I want to convert these 2 functions to TypeScript. 所以我想将这两个函数转换为TypeScript。 Is it possible? 可能吗? If I change .js to .ts do the other functions work well which are in js 如果我将.js更改为.ts,那么其他功能会很好

All JavaScript is valid TypeScript. 所有JavaScript是有效的TypeScript。 TypeScript is a superset of JavaScript. TypeScript是JavaScript的超集。

You should be able to simply change you .js files to .ts to see them work immediately. 您应该只需将.js文件更改为.ts,即可立即看到它们的工作。 Then, you can add in TypeScript specific code as you see fit. 然后,您可以根据需要添加TypeScript特定的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM