Update package dependencies and refactor types in Nostr-related components
- Upgrade @types/node to version 22.18.1 and add @types/qrcode version 1.5.5 in package.json and package-lock.json. - Refactor cleanupInterval and reconnectInterval types from NodeJS.Timeout to number in various Nostr-related files for better type compatibility. - Enhance error handling in useNostrclientHub and useNostrChat components by specifying error parameter types.
This commit is contained in:
parent
a551f46c90
commit
54b013490e
8 changed files with 65 additions and 28 deletions
|
|
@ -63,8 +63,8 @@ export class RelayHub extends EventEmitter {
|
|||
private connectedRelays: Map<string, Relay> = new Map()
|
||||
private subscriptions: Map<string, any> = new Map()
|
||||
public isInitialized = false
|
||||
private reconnectInterval?: NodeJS.Timeout
|
||||
private healthCheckInterval?: NodeJS.Timeout
|
||||
private reconnectInterval?: number
|
||||
private healthCheckInterval?: number
|
||||
private mobileVisibilityHandler?: () => void
|
||||
|
||||
// Connection state
|
||||
|
|
@ -400,7 +400,7 @@ export class RelayHub extends EventEmitter {
|
|||
this.reconnectInterval = setTimeout(async () => {
|
||||
|
||||
await this.connect()
|
||||
}, this.reconnectDelay)
|
||||
}, this.reconnectDelay) as unknown as number
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -413,7 +413,7 @@ export class RelayHub extends EventEmitter {
|
|||
|
||||
this.healthCheckInterval = setInterval(() => {
|
||||
this.performHealthCheck()
|
||||
}, this.healthCheckIntervalMs)
|
||||
}, this.healthCheckIntervalMs) as unknown as number
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue