-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for Typescript declare structures #1356
Improve support for Typescript declare structures #1356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
Co-Authored-By: Jordan Harband <[email protected]>
Thanks. Incorporated your change and fixed the issues with older typescript parsers. |
I don’t disagree, but I was trying to follow the style of the file. Happy to make a change, just let me know. |
Thanks, it'd be great to improve the readability in this PR :-) it's not a blocker, tho. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, much better :-)
Co-Authored-By: Jordan Harband <[email protected]>
Co-Authored-By: Jordan Harband <[email protected]>
Applied. |
@christophercurrie this does not cover situations like: export = supertest;
declare function supertest(app: any): supertest.SuperTest<supertest.Test>;
declare namespace supertest { ... } and import { snakeCase } from "./index";
export = snakeCase; I've raised #1527 for that. This was already a great help to understand what was going on :) |
This change improves support various forms used in Typescript declaration files. It's often necessary to change import resolution to prefer '.d.ts' files over '.js' files, but doing so breaks existing import resolution for certain types of UMD modules (React, for example).
This patch has two improvements:
export declare function foo()
syntax, which wasn't previously recognizedexport = Namespace
syntax for exporting everything in a namespace.The
import/named
tests were updated to add both variations as additional test files.