Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Test types#4140

Merged
jasonsaayman merged 10 commits into
axios:masterfrom
remcohaszing:test-types
Oct 12, 2021
Merged

Test types#4140
jasonsaayman merged 10 commits into
axios:masterfrom
remcohaszing:test-types

Conversation

@remcohaszing

@remcohaszing remcohaszing commented Oct 5, 2021

Copy link
Copy Markdown
Contributor

This asserts the type definitions work as expected for TypeScript 3.0 and above. This is the initial setup. I want to keep this minimal and add proper type assertions and some type fixes later. This is why the referenced issue isn’t closed yet.

This also fixes the axios defaults headers type.

I believe it’s a good idea to get this merged fast, so other TypeScript related issues and pull requests can be resolved more confidently.

Refs #4134
Closes #4108
Closes #4117
Closes #4132
Closes #4153
Closes #4157

caugner and others added 5 commits October 4, 2021 17:24
`axios.headers` is not of the same type as `request.headers`, so a new type
`AxiosDefaults` was introduced
This asserts that the type definitions are valid in the specified TypeScript
version and above. This is the same tool that is used by DefinitelyTyped.
@jasonsaayman

Copy link
Copy Markdown
Member

@remcohaszing can you please have a look at the merge conflict, please ping me when resolved.

@jasonsaayman jasonsaayman self-assigned this Oct 6, 2021
@remcohaszing

Copy link
Copy Markdown
Contributor Author

@jasonsaayman resolved!

@remcohaszing

remcohaszing commented Oct 6, 2021

Copy link
Copy Markdown
Contributor Author

You may want to merge #4115 first. The same change is included here, but not that exact commit. That PR was first, so I believe @caugner deserves credits for that. :)

@caugner caugner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no need to credit me for that missing semicolon

PS: Oops, too late, that PR is already merged.

Comment thread index.d.ts Outdated
@@ -1,3 +1,19 @@
// TypeScript Version: 3.0

export interface HeadersDefaults {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason to add this interface here at the beginning, rather than towards the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I didn’t really think about placement.

@remcohaszing

Copy link
Copy Markdown
Contributor Author

@jasonsaayman I’d like to point out #4066, #4136, and #4147 also look good. They don't conflict with each other, but some will cause conflict conflicts with this PR. If they all get merged, I can resolve the merge conflicts in here.

@jasonsaayman

Copy link
Copy Markdown
Member

Ok cool @remcohaszing I will look into all of that

@jasonsaayman

Copy link
Copy Markdown
Member

Seems that NPM had some downtime while I was trying to merge, I will look into this in a couple hours, thanks

@ssrikanta

Copy link
Copy Markdown

Any estimates, when this fix will be available would be very much helpful

@jasonsaayman

Copy link
Copy Markdown
Member

@remcohaszing can you mend these large merge conflicts then I can merge and do a release :)

@remcohaszing

Copy link
Copy Markdown
Contributor Author

@remcohaszing can you mend these large merge conflicts then I can merge and do a release :)

You were 2 seconds ahead of my push xD

@jasonsaayman

Copy link
Copy Markdown
Member

Thanks for this :) merging now

mbargiel pushed a commit to mbargiel/axios that referenced this pull request Jan 27, 2022
* Distinguish request and response data types

* Fix Axios headers type

`axios.headers` is not of the same type as `request.headers`, so a new type
`AxiosDefaults` was introduced

* Replace grunt-ts with dtslint

This asserts that the type definitions are valid in the specified TypeScript
version and above. This is the same tool that is used by DefinitelyTyped.

* Remove grunt-ts

* Restore typescript dependency

* Fix missing semicolons

Co-authored-by: Claas Augner <[email protected]>
Co-authored-by: Jay <[email protected]>
@remcohaszing remcohaszing deleted the test-types branch July 26, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants