简体   繁体   English

从 Javascript 转换回 Typescript

[英]Converting back from Javascript to Typescript

Is there any way to transpile back the Javascript code to Typescript, which has already been transpile to Javascript, from Typescript using Typescript compiler? Is there any way to transpile back the Javascript code to Typescript, which has already been transpile to Javascript, from Typescript using Typescript compiler? (Eg: tsc helloworld.ts) (例如:tsc helloworld.ts)

The issue is I have transpile the typescript source code to plain js, in order to deploy.问题是我已将 typescript 源代码转换为纯 js,以便部署。 After months, I have lost my source code but got the deployed js project.几个月后,我丢失了源代码,但得到了部署的 js 项目。

How should the compiler know where you've setted which type?编译器应该如何知道您在哪里设置了哪种类型? Obviously, he can't.显然,他不能。 So that doesn't work, you just could duplicate your js-file and set types manually.所以这不起作用,你可以复制你的 js 文件并手动设置类型。

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

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