diff --git a/src/Store/make-in-memory-store.ts b/src/Store/make-in-memory-store.ts index 8830911..a83da87 100644 --- a/src/Store/make-in-memory-store.ts +++ b/src/Store/make-in-memory-store.ts @@ -1,4 +1,4 @@ -import KeyedDB from '@adiwajshing/keyed-db' +import type KeyedDB from '@adiwajshing/keyed-db' import type { Comparable } from '@adiwajshing/keyed-db/lib/Types' import type { Logger } from 'pino' import { proto } from '../../WAProto' @@ -79,16 +79,16 @@ export default ( chatKey = chatKey || waChatKey(true) labelAssociationKey = labelAssociationKey || waLabelAssociationKey const logger = _logger || DEFAULT_CONNECTION_CONFIG.logger.child({ stream: 'in-mem-store' }) - // const KeyedDB = require('@adiwajshing/keyed-db').default as new (...args: any[]) => KeyedDB + const KeyedDB = require('@adiwajshing/keyed-db').default - const chats = new KeyedDB(chatKey, c => c.id) + const chats = new KeyedDB(chatKey, c => c.id) as KeyedDB const messages: { [_: string]: ReturnType } = {} const contacts: { [_: string]: Contact } = {} const groupMetadata: { [_: string]: GroupMetadata } = {} const presences: { [id: string]: { [participant: string]: PresenceData } } = {} const state: ConnectionState = { connection: 'close' } const labels = new ObjectRepository