I am constructing an npm module in typescript, which when published will contain the generated .d.ts, '.js' and '.js.map' files. This module will in turn be dependent on other modules eg. react, react-dom. Now my question is, when someone installs my module in their app, How do i check whether the installing app is a typescript or javascript project, and if it is a typescript project how do i automatically install the required typings dependencies specified in my module's typings.json.
If there is something wrong with the approach i am going for here, then any other approach is also welcome.