Files
InfiniteAPI/src/Types/State.ts
T
Adhiraj Singh d386f2db8b Implement Legacy Socket Capability in MD Code (#1041)
* feat: add legacy connection

* fix: merge conflict errors

* feat: functional legacy socket
2021-12-17 20:59:43 +05:30

25 lines
628 B
TypeScript

import { Contact } from "./Contact"
export type WAConnectionState = 'open' | 'connecting' | 'close'
export type ConnectionState = {
/** connection is now open, connecting or closed */
connection: WAConnectionState
/** the error that caused the connection to close */
lastDisconnect?: {
error: Error
date: Date
}
/** is this a new login */
isNewLogin?: boolean
/** the current QR code */
qr?: string
/** has the device received all pending notifications while it was offline */
receivedPendingNotifications?: boolean
/** legacy connection options */
legacy?: {
phoneConnected: boolean
user?: Contact
}
}