tsc: fix builds & fix type errors

This commit is contained in:
Rajeh Taher
2025-07-19 17:15:51 +03:00
parent 97dfccf9fe
commit 29f0ac83f8
7 changed files with 23 additions and 17 deletions
+3 -2
View File
@@ -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
+2 -2
View File
@@ -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
})
+2 -2
View File
@@ -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]!)
}
}