tornapi-typescript
v5.2.0
Published
[](https://www.npmjs.com/package/tornapi-typescript) [](https://www.npmjs.com/package/tornapi-typescript)
Readme
TornAPI Typescript
Automatically generated type definition in TypeScript for torn.com API V2. Includes a client for both API V1 and V2.
Installation
npm i -D tornapi-typescript
Generation
V1 types
Based on data provided by tornapi-documentation. Code mostly provided from Kwack's V1 wrapper. These types are not available without using the client.
V1 client
Code mostly provided from Kwack's V1 wrapper. Uses the types as generated above.
V2 types
The V2 types are generated in the following way:
- load openapi specification
- convert the specification to TypeScript definitions using typeconv
- clean the type definitions
- remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
- remove all empty objects (caused by the above cleaning)
- run through prettier to have it look decent
V2 client
Code mostly provided from Kwack's V1 wrapper.
Contact
You can join the community in our Discord server. There you can discuss anything related to the Torn API or other tools related to Torn. Issues can also be reported there, or as GitHub issue.
