add missing Headers interface augmentation from lib.dom.iterable.d.ts#97
Merged
Conversation
lquixada
reviewed
Mar 19, 2021
| Response, | ||
| ResponseInit, | ||
| } from "./lib.fetch" | ||
| import type { Headers as IterHeaders } from "./lib.fetch.dom.iterable"; |
Owner
There was a problem hiding this comment.
I think we should abbreviate the file name to lib.fetch.iterable
Owner
There was a problem hiding this comment.
also, don't forget to add this file to the files property on package.json
lquixada
reviewed
Mar 19, 2021
| const headers = new Headers(); | ||
| for (const h of headers) { | ||
|
|
||
| } |
Owner
There was a problem hiding this comment.
I feel this file won't be needed anymore.
declaration files were generated and tested 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 ES2016 --target ES2016 --noEmit 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
- source: typescript/lib/lib.dom.iterable.d.ts
output: lib.fetch.dom.iterable.d.ts
include:
- Headers
EOF
1d79080 to
215e1ca
Compare
lquixada
approved these changes
Mar 19, 2021
Owner
|
thanks @jstewmon ! great job! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added test.ts to support type checking the type declaration files.
declaration files were generated and tested with the following command:
Fixes #95
Until ts-graft can automatically merge the declarations, I thought the easy fix for now is to graft each lib file and combine the declarations manually in index.d.ts.