mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: add type distinguisher for sockets
This commit is contained in:
@@ -363,6 +363,7 @@ export const makeSocket = ({
|
||||
})
|
||||
|
||||
return {
|
||||
type: 'legacy',
|
||||
ws,
|
||||
updateKeys: (info: { encKey: Buffer, macKey: Buffer }) => authInfo = info,
|
||||
waitForSocketOpen,
|
||||
|
||||
@@ -540,6 +540,7 @@ export const makeSocket = ({
|
||||
ev.on('creds.update', update => Object.assign(creds, update))
|
||||
|
||||
return {
|
||||
type: 'md',
|
||||
ws,
|
||||
ev,
|
||||
authState: {
|
||||
|
||||
@@ -14,4 +14,6 @@ export { makeWALegacySocket }
|
||||
|
||||
export type WASocket = ReturnType<typeof makeWASocket>
|
||||
|
||||
export type AnyWASocket = WASocket | WALegacySocket
|
||||
|
||||
export default makeWASocket
|
||||
Reference in New Issue
Block a user