简体   繁体   中英

API Documentation for typescript types for JS libraries

I am trying to develop an exrpessjs application in typescript. I installed @types and developed a working application after reading some articles. My question is where do I find documentation for typescript types for the libraries written in javascript.

For example I learned from examples that I need to import Router, Response and Request as follows, I am looking for an official documentation where it lists classes, interfaces that the library exposes through @types

import { Router, Response, Request } from 'express';

learned from examples that I need to import Router, Response and Request as follows,

If the JS library is not written in TypeScript it probably has its own docs you should refer to eg Router is covered here : https://expressjs.com/en/guide/routing.html

Other than that the usage of definitions can be figured out by autocomplete etc.

More

In general TypeScript does not solve the problem of poorly documented or bad code. That is left up to the developers (just like any other programming language).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM