1

In particular, I'm trying to use ldapjs, which has only a partial TypeScript definition @types/ldapjs.

Because it's incomplete, I just want to use the methods in the ldapjs lib directly. Is that possible? All the tutorials/answers I find assume that there is a type definition module available. What to do when none is available?

2 Answers 2

1

Firstly you need to import it as follows:

import * as ldapjs from 'ldapjs';

Next you can instantiate it as follows:

let ldapjsInstance = ldapjs();

Then you can use any of its variables & functions.

Sign up to request clarification or add additional context in comments.

Comments

0

You can also try to run the library through https://github.com/Microsoft/dts-gen which will attempt to create types for the library. It is not totally fool proof but it will generate the basic skeleton for the types

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.