Files
DefinitelyTyped/ldapjs/ldapjs-tests.ts
Rogier Schouten 92cf2a36b1 Add typings for ldapjs. (#11783)
* Add typings for ldapjs.

* process review comment
2016-10-08 10:33:18 -07:00

21 lines
408 B
TypeScript

import ldap = require("ldapjs");
let client = ldap.createClient({
url: 'ldap://127.0.0.1:1389'
});
client.bind('cn=root', 'secret', (err: Error): void => {
// nothing
});
let opts: ldap.SearchOptions = {
filter: '(&(l=Seattle)(email=*@foo.com))',
scope: 'sub',
attributes: ['dn', 'sn', 'cn']
};
client.search('o=example', opts, (err: Error, res: NodeJS.EventEmitter): void => {
// nothing
});