I have the following code:
import {AsyncLock} from 'async-lock';
but tsc is complaining:
[ts] Module '"my_app/node_modules/@types/async-lock/index"' has no exported member 'AsyncLock'.
but if I look at my_app/node_modules/@types/async-lock/index.d.ts I see the following:
interface AsyncLockDoneCallback {
(err?: Error, ret?: any): void;
}
interface AsyncLockOptions {
timeout?: number;
maxPending?: number;
domainReentrant?: boolean;
Promise?: any;
}
declare class AsyncLock {
constructor(options?: AsyncLockOptions);
acquire(key: string | string[], fn: (done: AsyncLockDoneCallback)
=> any, cb: AsyncLockDoneCallback, opts?: AsyncLockOptions): void;
acquire(key: string | string[], fn: (done: AsyncLockDoneCallback)
=> any, opts?: AsyncLockOptions): PromiseLike<any>;
isBusy(): boolean;
}
declare namespace AsyncLock { }
export = AsyncLock;
It very much looks to me as if AsyncLock is being exported here. Where am I going wrong with my import definition?