node-ldapauth-fork
node-ldapauth-fork copied to clipboard
Typescript definition doesn't export class LdapAuth
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.
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.
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.