What are the criteria for .d.ts files to be loaded(/when are they loaded) and from what directories?

Still relative new to Typescript itself and I’ve been breaking my head on when .d.ts files get loaded.

For now I’ve been putting everything in the src directory with everything else, but that feels counter intuitive.

I’ve peered over all the TS documentation and there doesn’t seem to be a conclusive answer.

I’ve also found the types option for package.json.

Before I dive into the sources, can someone explain this to me?

Are .d.ts parsed anywhere in the path? Just under the baseUrl option in tsconfig.json or types directories specified in the package.json? And what is the priority/order in which those directories/paths get evaluated?