How to grap all TypeStyles of a Library or File


I am currently developing an export-script for our design-library. I am already loading, parsing and exporting the colors and I am thrilled by the possibilities of the API.

Now I am targeting the Type-Styles:
My first approach is using the file-Endpoint. I see all the relevant infos like font, size, weight and so on and I also see the linked text-style, so I would be able to puzzle it together but I am a little bit afraid of the EdgeCases like (to styles in on Element and so on). Also this means that I am only able to reach Styles which are currently in use “somewhere”…

I also have seen the styles-endpoint which lists all styles, but without the needed informations.

Am I missing something? Thanks for some help