mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: lint
This commit is contained in:
@@ -4,4 +4,5 @@ coverage
|
||||
*.lock
|
||||
.eslintrc.json
|
||||
src/WABinary/index.ts
|
||||
WAProto
|
||||
WAProto
|
||||
WASignalGroup
|
||||
@@ -1,11 +1,11 @@
|
||||
module.exports = {
|
||||
"roots": [
|
||||
"<rootDir>/src"
|
||||
'roots': [
|
||||
'<rootDir>/src'
|
||||
],
|
||||
"testMatch": [
|
||||
"**/Tests/test.*.+(ts|tsx|js)",
|
||||
'testMatch': [
|
||||
'**/Tests/test.*.+(ts|tsx|js)',
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.(ts|tsx)$": "ts-jest"
|
||||
'transform': {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest'
|
||||
},
|
||||
}
|
||||
@@ -24,8 +24,8 @@
|
||||
"build:tsc": "tsc",
|
||||
"example": "node --inspect -r ts-node/register Example/example.ts",
|
||||
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
||||
"lint": "eslint ./src --ext .js,.ts,.jsx,.tsx",
|
||||
"lint:fix": "eslint ./src --fix --ext .js,.ts,.jsx,.tsx"
|
||||
"lint": "eslint . --ext .js,.ts,.jsx,.tsx",
|
||||
"lint:fix": "eslint . --fix --ext .js,.ts,.jsx,.tsx"
|
||||
},
|
||||
"author": "Adhiraj Singh",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -74,7 +74,7 @@ export type ChatModification =
|
||||
}
|
||||
| {
|
||||
star: {
|
||||
messages: { id: string, fromMe?: boolean }[],
|
||||
messages: { id: string, fromMe?: boolean }[]
|
||||
star: boolean
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export type BufferedEventData = {
|
||||
messageUpdates: { [key: string]: WAMessageUpdate }
|
||||
messageDeletes: { [key: string]: WAMessageKey }
|
||||
messageReactions: { [key: string]: { key: WAMessageKey, reactions: proto.IReaction[] } }
|
||||
messageReceipts: { [key: string]: { key: WAMessageKey, userReceipt: proto.IUserReceipt[] } },
|
||||
messageReceipts: { [key: string]: { key: WAMessageKey, userReceipt: proto.IUserReceipt[] } }
|
||||
groupUpdates: { [jid: string]: Partial<GroupMetadata> }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Contact } from './Contact'
|
||||
|
||||
export type GroupParticipant = (Contact & { isAdmin?: boolean; isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null })
|
||||
export type GroupParticipant = (Contact & { isAdmin?: boolean, isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null })
|
||||
|
||||
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ export type AnyRegularMessageContent = (
|
||||
listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>
|
||||
}
|
||||
| {
|
||||
product: WASendableProduct,
|
||||
product: WASendableProduct
|
||||
businessOwnerJid?: string
|
||||
body?: string
|
||||
footer?: string
|
||||
|
||||
@@ -2,7 +2,7 @@ import { WAMediaUpload } from './Message'
|
||||
|
||||
export type CatalogResult = {
|
||||
data: {
|
||||
paging: { cursors: { before: string, after: string } },
|
||||
paging: { cursors: { before: string, after: string } }
|
||||
data: any[]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,21 +15,21 @@ export type SocketConfig = {
|
||||
/** the WS url to connect to WA */
|
||||
waWebSocketUrl: string | URL
|
||||
/** Fails the connection if the socket times out in this interval */
|
||||
connectTimeoutMs: number
|
||||
connectTimeoutMs: number
|
||||
/** Default timeout for queries, undefined for no timeout */
|
||||
defaultQueryTimeoutMs: number | undefined
|
||||
/** ping-pong interval for WS connection */
|
||||
keepAliveIntervalMs: number
|
||||
/** proxy agent */
|
||||
agent?: Agent
|
||||
agent?: Agent
|
||||
/** pino logger */
|
||||
logger: Logger
|
||||
logger: Logger
|
||||
/** version to connect with */
|
||||
version: WAVersion
|
||||
/** override browser config */
|
||||
browser: WABrowserDescription
|
||||
/** agent used for fetch requests -- uploading/downloading media */
|
||||
fetchAgent?: Agent
|
||||
browser: WABrowserDescription
|
||||
/** agent used for fetch requests -- uploading/downloading media */
|
||||
fetchAgent?: Agent
|
||||
/** should the QR be printed in the terminal */
|
||||
printQRInTerminal: boolean
|
||||
/** should events be emitted for actions done by this socket connection */
|
||||
|
||||
@@ -52,4 +52,4 @@ export type WABusinessProfile = {
|
||||
address?: string
|
||||
}
|
||||
|
||||
export type CurveKeyPair = { private: Uint8Array; public: Uint8Array }
|
||||
export type CurveKeyPair = { private: Uint8Array, public: Uint8Array }
|
||||
@@ -136,7 +136,7 @@ export const delayCancellable = (ms: number) => {
|
||||
return { delay, cancel }
|
||||
}
|
||||
|
||||
export async function promiseTimeout<T>(ms: number | undefined, promise: (resolve: (v?: T)=>void, reject: (error) => void) => void) {
|
||||
export async function promiseTimeout<T>(ms: number | undefined, promise: (resolve: (v?: T) => void, reject: (error) => void) => void) {
|
||||
if(!ms) {
|
||||
return new Promise(promise)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user