diff options
author | Florian Dold <florian@dold.me> | 2021-02-18 11:25:23 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-02-18 11:25:23 +0100 |
commit | c800e80138358430b924937b2f4fed69376181ce (patch) | |
tree | 0039a6faa8422ecc47b1cdf370f801098943b8af /packages/idb-bridge/src/index.ts | |
parent | fe1b9efae56b093bf9cb7c27bce7252623a04a20 (diff) | |
download | wallet-core-c800e80138358430b924937b2f4fed69376181ce.tar.xz |
idb: fix shimming
Diffstat (limited to 'packages/idb-bridge/src/index.ts')
-rw-r--r-- | packages/idb-bridge/src/index.ts | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/packages/idb-bridge/src/index.ts b/packages/idb-bridge/src/index.ts index b6c15249d..2cb8bcf15 100644 --- a/packages/idb-bridge/src/index.ts +++ b/packages/idb-bridge/src/index.ts @@ -12,7 +12,7 @@ import { ResultLevel, IndexProperties, } from "./backend-interface"; -import FakeEventTarget, { Listener } from "./util/FakeEventTarget"; +import { Listener } from "./util/FakeEventTarget"; import { DatabaseDump, ObjectStoreDump, @@ -32,6 +32,7 @@ import { BridgeIDBOpenDBRequest, BridgeIDBRequest, BridgeIDBTransaction, + BridgeIDBVersionChangeEvent, DatabaseList, RequestObj, } from "./bridge-idb"; @@ -97,29 +98,20 @@ export { MemoryBackend } from "./MemoryBackend"; */ export function shimIndexedDB(factory: BridgeIDBFactory): void { // @ts-ignore: shimming - globalThis.indexedDB = factory; - // @ts-ignore: shimming - globalThis.IDBCursor = BridgeIDBCursor; - // @ts-ignore: shimming - globalThis.IDBKeyRange = BridgeIDBKeyRange; - // @ts-ignore: shimming - globalThis.IDBDatabase = BridgeIDBDatabase; - // @ts-ignore: shimming - globalThis.IDBFactory = BridgeIDBFactory; - // @ts-ignore: shimming - globalThis.IDBIndex = BridgeIDBIndex; - // @ts-ignore: shimming - globalThis.IDBKeyRange = BridgeIDBKeyRange; - // @ts-ignore: shimming - globalThis.IDBObjectStore = BridgeIDBObjectStore; - // @ts-ignore: shimming - globalThis.IDBOpenDBRequest = BridgeIDBOpenDBRequest; - // @ts-ignore: shimming - globalThis.IDBRequest = BridgeIDBRequest; - // @ts-ignore: shimming - globalThis.IDBTransaction = BridgeIDBTransaction; - // @ts-ignore: shimming - globalThis.IDBVersionChangeEvent = BridgeIDBVersionChangeEvent; + const g = globalThis as any; + + g.indexedDB = factory; + g.IDBCursor = BridgeIDBCursor; + g.IDBKeyRange = BridgeIDBKeyRange; + g.IDBDatabase = BridgeIDBDatabase; + g.IDBFactory = BridgeIDBFactory; + g.IDBIndex = BridgeIDBIndex; + g.IDBKeyRange = BridgeIDBKeyRange; + g.IDBObjectStore = BridgeIDBObjectStore; + g.IDBOpenDBRequest = BridgeIDBOpenDBRequest; + g.IDBRequest = BridgeIDBRequest; + g.IDBTransaction = BridgeIDBTransaction; + g.IDBVersionChangeEvent = BridgeIDBVersionChangeEvent; } export * from "./idbtypes"; |