Typescript is a language that runs on top of Javascript. At least she was designed for this, nothing prevents her one day to change course, but the goal is to continue like this. She uses a technique called transpilation where the compiler reads the code in TS and writes another in JS. The code in TS does not need to be distributed anywhere. The JS code is distributed and this is the one you can see. Unless whoever wrote the TS code provides you directly.
If you are looking for the sources of the TS library then it has at least nothing substantial, it uses the JS library. If you want the compiler sources you have in https://github.com/microsoft/TypeScript. Ali has something library, basically to establish contracts what already exists in JS.
If what you’re talking about interface
is precisely that this library published there only has these statements and not the implementation of the code of these interfaces so it has nothing to show because it has not implemented anything (or almost nothing), is what I said is already all ready in the JS library. What are you seeing in these files .d.ts
is just a way to create contracts for what already exists and to be able to use in your code according to the rules of the language. Since in JS there is no contract, there are no interfaces and types, and TS does, so the only thing TS has to add is the contract to everything, so it creates the interfaces and tells you which types a function accepts.
Interfaces need to be implemented to use, but they are already in JS, do not have to do again, would only bring problems try to do it again.
The goal of Typescript is basically to create contracts for Javascript and give more robustness and allow larger and more complex code bases than can be done in JS.
Most libraries available for JS have the same feature of creating contracts for use in statically typed form (although this term does not look good in this type of language, because it has a bark like this, but in the end it will generate something that has the same performance problem of dynamic typing, and nothing prevents that at another point the robustness is circumvented). The place that centralizes this is the Definitelytyped. There are contracts, implementations are in libs written in JS without the contract part which is a feature that JS does not have.