*.d.ts
files serve the purpose of providing TypeScript type information for JavaScript modules such as underscore, lodash, and aws-sdk.
By using these declaration files, you can seamlessly use JavaScript modules in your TypeScript code without having to convert them to TypeScript, thus avoiding any errors.
For instance, if you have a folder named myAwesomeLib with index.js and index.d.ts files:
You can simply import the code like this:
import { SomeMethod } from './myAwesomeLib';
or
import { SomeMethod } from './myAwesomeLib/index';
Your TypeScript code will rely on the .d.ts file to provide the correct types for the SomeMethod function.
Edit: For more information on Declaration files, check out https://basarat.gitbooks.io/typescript/docs/types/ambient/d.ts.html