title: Typescript: is it possible to generate a ts file from declaration file and .js file?
body: <p>I know declaration files are meant for libraries and not for projects.</p>
  
  <p>But lets assume i have an existing js project that I want to migrate to .ts and I want to start by creating d.ts files for each file in my source.</p>
  
  <p>That way,</p>
  
  <p>1- I don't enforce my team to use typescript while getting the benefits of typescript compiler features in my IDE. People can keep committing .js files. And use of typescript in the project is left to the developer. By creating d.ts files for each file they can get the benefits of type safety.
  But it also hinders development in a sense that when a developer changes a js file, the d.ts file for that file also has to be changed. So as a shortcut i want to be able to generate a .ts file from existing d.ts and .js files and do the development there. It makes sense to create a d.ts file and .js file for committing to the remote source so that the source is left clean and approachable by people who are not used to typescript.</p>
  
  <p>2- And can we generate d.ts files with dts-gen to have an head start, then add remaining types manually.</p>
  
  <p>3- Also: compability with react.</p>
  
  <p>4- And, what is the right way to generate dts files for a project that does not consist of a single file? What is the right way to do it in your experience?</p>
  
  <p>So how possible is this pipeline? What are the chances of this working, and what are the barriers that are blocking us? What suggestions can I get for this? </p>
  
  <p>Thanks in advance!</p>