0

I'm trying to write a type definitions file for an npm module so everything I'm doing is within a declare module 'module-name' {} block. One of the exported members of the module is an asynchronous method. I haven't yet found a way to add it.

Does it need to be declared an async function or should the signature just be a function returning a Promise?

1 Answer 1

1

It should just be a function returning a Promise. The async modifier is only relevant when you are giving the function implementation.

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

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.