I see people using extensions like .d.ts
, .schema.ts
, .route.ts
, routes.ts
and basically anything and everything, so I was wondering if there is no limit to the extensions you can give to your files in typescript/javascript (I've seen people do this with javascript too). So someone kindly explain what are these extensions and how to use them.
Thank you.
Edits for clarification:
In web development projects, especially when they use typescript for development, sometimes the devs use filenames that end with seemingly arbitrary extensions. Some common file extensions that I've seen are filename.d.ts
, filename.route.ts
, filename.actions.ts
etc. Coming from a development environment where file extensions play a major role in how a sepcific file behaves (Python, Java and C), this made me very confused and I couldn't figure out:
The extension of a file is always the portion after the rightmost dot.
Hence, the extension of all the files you mention is .ts
. We can add as many dots in the middle of a file name as we want, only the last one matters for the extension.