tsc: fix builds & fix type errors
This commit is contained in:
+3
-2
@@ -4,6 +4,7 @@ import { proto } from '../../WAProto'
|
||||
import { DEFAULT_CACHE_TTLS, PROCESSABLE_HISTORY_TYPES } from '../Defaults'
|
||||
import type {
|
||||
BotListInfo,
|
||||
CacheStore,
|
||||
ChatModification,
|
||||
ChatMutation,
|
||||
LTHashState,
|
||||
@@ -73,10 +74,10 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
|
||||
const placeholderResendCache =
|
||||
config.placeholderResendCache ||
|
||||
new NodeCache({
|
||||
(new NodeCache<number>({
|
||||
stdTTL: DEFAULT_CACHE_TTLS.MSG_RETRY, // 1 hour
|
||||
useClones: false
|
||||
})
|
||||
}) as CacheStore)
|
||||
|
||||
if (!config.placeholderResendCache) {
|
||||
config.placeholderResendCache = placeholderResendCache
|
||||
|
||||
@@ -83,13 +83,13 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
|
||||
const msgRetryCache =
|
||||
config.msgRetryCounterCache ||
|
||||
new NodeCache({
|
||||
new NodeCache<number>({
|
||||
stdTTL: DEFAULT_CACHE_TTLS.MSG_RETRY, // 1 hour
|
||||
useClones: false
|
||||
})
|
||||
const callOfferCache =
|
||||
config.callOfferCache ||
|
||||
new NodeCache({
|
||||
new NodeCache<WACallEvent>({
|
||||
stdTTL: DEFAULT_CACHE_TTLS.CALL_OFFER, // 5 mins
|
||||
useClones: false
|
||||
})
|
||||
|
||||
@@ -75,7 +75,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
|
||||
const userDevicesCache =
|
||||
config.userDevicesCache ||
|
||||
new NodeCache({
|
||||
new NodeCache<JidWithDevice[]>({
|
||||
stdTTL: DEFAULT_CACHE_TTLS.USER_DEVICES, // 5 minutes
|
||||
useClones: false
|
||||
})
|
||||
@@ -237,7 +237,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
}
|
||||
|
||||
for (const key in deviceMap) {
|
||||
userDevicesCache.set(key, deviceMap[key])
|
||||
userDevicesCache.set(key, deviceMap[key]!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user