jameslnewell / xhr-mock

Utility for mocking XMLHttpRequest.
196 stars 48 forks source link

fix types export to support typescript 3.7 #93

Closed OriMarron closed 4 years ago

OriMarron commented 4 years ago

The Problem: Typescript 3.7 (released yesterday) introduced a breaking change, and compiling xhr-mock with the new version now fails.

https://devblogs.microsoft.com/typescript/announcing-typescript-3-7/#local-and-imported-type-declarations-now-conflict

It is now illegal to redeclare an imported type.

This already started breaking the build of some users.

The Fix: instead of re-declaring MockHeaders type, simply re-export it. This does not affect anything else, since the types are identical.

jameslnewell commented 4 years ago

Thanks for taking the time to support and contribute to xhr-mock across multiple PRs! I've merged https://github.com/jameslnewell/xhr-mock/pull/92 this time.