I'm getting a type error when passing a localforage instance to the localStorage property in ExternalsOptions.
Type 'LocalForage' is not assignable to type 'Storage'.
Types of property 'length' are incompatible.
Type '(callback?: ((err: any, numberOfKeys: number) => void) | undefined) => Promise<number>' is not assignable to type 'number'.ts(2322)
This is likely because the ExternalsOptions type is not currently compatible with the asynchronous storage interface. The relevant code is as follows:
export interface ExternalsOptions {
fetch?: typeof fetch;
Request?: typeof Request;
Response?: typeof Response;
Headers?: typeof Headers;
localStorage?: Storage;
}
I'm getting a type error when passing a
localforageinstance to thelocalStorageproperty inExternalsOptions.This is likely because the ExternalsOptions type is not currently compatible with the asynchronous storage interface. The relevant code is as follows: