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

Typescript integration #22

Closed
jeffrson opened this issue Feb 22, 2019 · 4 comments
Closed

Typescript integration #22

jeffrson opened this issue Feb 22, 2019 · 4 comments

Comments

@jeffrson
Copy link
Contributor

Hi,
would love to see typescript support like
import { SFTP } from 'ssh2-promise'

Currently there seems to be no way to access the type of SFTP (in class or interface) at all.

@sanketbajoria
Copy link
Owner

Currently it is exposed as below
var SFTP = require('ssh2-promise').SFTP

@jeffrson
Copy link
Contributor Author

Then it's just "any".

@grammati
Copy link

Workaround:

import Ssh from "ssh2-promise";
const dummy = () => new Ssh({}).sftp();
type SFTP = ReturnType<typeof dummy>;

@unki2aut unki2aut mentioned this issue Nov 2, 2020
@sanketbajoria
Copy link
Owner

Now we support SFTP type

//without esModuleInterop
import SFTP = require('ssh2-promise/lib/sftp')

//with esModuleInterop
import SFTP from 'ssh2-promise/lib/sftp'

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

No branches or pull requests

3 participants