lquixada / cross-fetch

Universal WHATWG Fetch API for Node, Browsers and React Native.
MIT License
1.67k stars 104 forks source link

add missing fetch api types from constructor signatures #96

Closed jstewmon closed 3 years ago

jstewmon commented 3 years ago

lib.fetch.d.ts was generated and validated with the following command:

npm i --no-save typescript@4.2.3 \
&& cat <<EOF > .ts-graftrc.yaml \
&& npx ts-graft@1.0.1 \
&& rm .ts-graftrc.yaml \
&& npx tsc --lib ES6 index.d.ts \
&& npm un typescript
grafts:
- source: typescript/lib/lib.dom.d.ts
  output: lib.fetch.d.ts
  include:
    - BodyInit
    - HeadersInit
    - RequestInfo
    - RequestInit
    - Response
    - ResponseInit
EOF
lquixada commented 3 years ago

@jstewmon thanks for the quick response! 👍 I'll add a task on CI to run a type check as well.

lquixada commented 3 years ago

This also solves #94 .