mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Usync: Barebones Usync Protocol support (#960)
* feature(feature/usync-mex): initial commit * chore: fix merge commit * chore:lint
This commit is contained in:
27
src/Types/USync.ts
Normal file
27
src/Types/USync.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { BinaryNode } from '../WABinary'
|
||||
import { USyncUser } from '../WAUSync'
|
||||
|
||||
/**
|
||||
* Defines the interface for a USyncQuery protocol
|
||||
*/
|
||||
export interface USyncQueryProtocol {
|
||||
/**
|
||||
* The name of the protocol
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* Defines what goes inside the query part of a USyncQuery
|
||||
*/
|
||||
getQueryElement: () => BinaryNode
|
||||
/**
|
||||
* Defines what goes inside the user part of a USyncQuery
|
||||
*/
|
||||
getUserElement: (user: USyncUser) => BinaryNode | null
|
||||
|
||||
/**
|
||||
* Parse the result of the query
|
||||
* @param data Data from the result
|
||||
* @returns Whatever the protocol is supposed to return
|
||||
*/
|
||||
parser: (data: BinaryNode) => unknown
|
||||
}
|
||||
Reference in New Issue
Block a user