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 definition doesn't export class LdapAuth #54

Open
Eymux opened this issue Sep 20, 2017 · 2 comments
Open

Typescript definition doesn't export class LdapAuth #54

Eymux opened this issue Sep 20, 2017 · 2 comments

Comments

@Eymux
Copy link

Eymux commented Sep 20, 2017

In ldapauth.d.ts the class LdapAuth isn't part of the namespace LdapAuth and isn't exported.

Moving the class to the namespace seems to fix this.

@vesse
Copy link
Owner

vesse commented Sep 20, 2017

It might be incorrect, yes, as I find writing those typedefs a bit cumbersome. I did follow examples of existing typedefs and can use it like I intended:

import * as LdapAuth from 'ldapauth-fork';

const la = new LdapAuth({
  url: 'url',
  bindDN: 'test',
  bindCredentials: 'test',
  searchBase: 'base',
  searchFilter: 'filter'
});

la.authenticate('uname', 'password', () => {
  console.log('done')
})

If the class is moved inside the namespace the I should do new LdapAuth.LdapAuth in the example above.

@Eymux
Copy link
Author

Eymux commented Sep 21, 2017

Sorry, I was using the wrong account.

If the class is in the namespace it can be imported like this:

import { LdapAuth } from 'ldapauth-fork';

Which is nicer and I believe how it should be.

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

2 participants