When working with asynchronous callbacks in a promise
promise.then(async callbackResultValue => { //here })
I experimented with this code:
const browserd = await import('browser-detect');
if (typeof browserd === 'function') {
const browserinfo = browserd();
}
The result I received was:
[ts] Cannot invoke an expression whose type lacks a call signature. Type 'never' has no compatible call signatures.
After that, I attempted the following:
const browserd:Function = await import('browser-detect');
This generated the error message:
[ts] Type 'typeof import("
<path-to-npm-module>
' is not assignable to type 'Function'. Property 'apply' is missing in type 'typeof import("<path-to-npm-module>
'.