Skip to content
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

Update exports for Typescript 2.6 #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akane30
Copy link

@akane30 akane30 commented Feb 16, 2018

Typescript 2.6+ does not allow the default export that's currently in these types, so this PR removes the default export.

If it's preferred, I could also add a default export class or namespace which contains the 3 functions the original did to maintain backwards compatibility for anyone using the default export.

I also added the closeConnection() method to the GremlinClient so you can actually close the connection in Typescript without using a type assertion as a workaround.

Typescript 2.6 removed support for default exports of a declared object,
as was done previously in this file. This change could be made backwards
compatible by adding a default export with the old default members, but
it seems better to avoid the default export functions which are already
exported.
@unional
Copy link
Contributor

unional commented Feb 16, 2018

Don't see why not. cc @felixfbecker @blakeembrey

@grreeenn
Copy link

grreeenn commented Apr 5, 2018

alternative workaround here, if default export is necessary https://stackoverflow.com/questions/47094210/d-ts-not-compiling-after-typescript-2-6-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants