diff --git a/src/Types/Chat.ts b/src/Types/Chat.ts index cd29cba..ae21813 100644 --- a/src/Types/Chat.ts +++ b/src/Types/Chat.ts @@ -74,7 +74,7 @@ export type ChatModification = } | { star: { - messages: { id: string, fromMe?: boolean }[], + messages: { id: string, fromMe?: boolean }[] star: boolean } } diff --git a/src/Types/Events.ts b/src/Types/Events.ts index 4e1866e..e4fc942 100644 --- a/src/Types/Events.ts +++ b/src/Types/Events.ts @@ -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 } } diff --git a/src/Types/GroupMetadata.ts b/src/Types/GroupMetadata.ts index 8a47fc7..15eb69b 100644 --- a/src/Types/GroupMetadata.ts +++ b/src/Types/GroupMetadata.ts @@ -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' diff --git a/src/Types/Message.ts b/src/Types/Message.ts index d2a6964..d4eccbb 100644 --- a/src/Types/Message.ts +++ b/src/Types/Message.ts @@ -154,7 +154,7 @@ export type AnyRegularMessageContent = ( listReply: Omit } | { - product: WASendableProduct, + product: WASendableProduct businessOwnerJid?: string body?: string footer?: string diff --git a/src/Types/Product.ts b/src/Types/Product.ts index 4fcb0fc..159416a 100644 --- a/src/Types/Product.ts +++ b/src/Types/Product.ts @@ -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[] } } diff --git a/src/Types/Socket.ts b/src/Types/Socket.ts index 5144fdd..9083b5e 100644 --- a/src/Types/Socket.ts +++ b/src/Types/Socket.ts @@ -43,7 +43,7 @@ export type SocketConfig = { /** time to wait between sending new retry requests */ retryRequestDelayMs: number /** time to wait for the generation of the next QR in ms */ - qrTimeout?: number; + qrTimeout?: number /** provide an auth state object to maintain the auth state */ auth: AuthenticationState /** manage history processing with this control; by default will sync up everything */ diff --git a/src/Types/index.ts b/src/Types/index.ts index 78ea6f4..57ca635 100644 --- a/src/Types/index.ts +++ b/src/Types/index.ts @@ -52,4 +52,4 @@ export type WABusinessProfile = { address?: string } -export type CurveKeyPair = { private: Uint8Array; public: Uint8Array } \ No newline at end of file +export type CurveKeyPair = { private: Uint8Array, public: Uint8Array } \ No newline at end of file diff --git a/src/Utils/generics.ts b/src/Utils/generics.ts index ea730b6..16c016a 100644 --- a/src/Utils/generics.ts +++ b/src/Utils/generics.ts @@ -136,7 +136,7 @@ export const delayCancellable = (ms: number) => { return { delay, cancel } } -export async function promiseTimeout(ms: number | undefined, promise: (resolve: (v?: T)=>void, reject: (error) => void) => void) { +export async function promiseTimeout(ms: number | undefined, promise: (resolve: (v?: T) => void, reject: (error) => void) => void) { if(!ms) { return new Promise (promise) } diff --git a/src/Utils/messages-media.ts b/src/Utils/messages-media.ts index 26b6bc3..c8eb0cf 100644 --- a/src/Utils/messages-media.ts +++ b/src/Utils/messages-media.ts @@ -78,7 +78,7 @@ const extractVideoThumb = async( path: string, destPath: string, time: string, - size: { width: number; height: number }, + size: { width: number, height: number }, ) => new Promise((resolve, reject) => { const cmd = `ffmpeg -ss ${time} -i ${path} -y -vf scale=${size.width}:-1 -vframes 1 -f image2 ${destPath}` exec(cmd, (err) => { @@ -243,7 +243,7 @@ export async function generateThumbnail( } ) { let thumbnail: string | undefined - let originalImageDimensions: { width: number; height: number } | undefined + let originalImageDimensions: { width: number, height: number } | undefined if(mediaType === 'image') { const { buffer, original } = await extractImageThumb(file) thumbnail = buffer.toString('base64') diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index d20360e..de04bfe 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -627,7 +627,7 @@ export const normalizeMessageContent = (content: WAMessageContent | null | undef || message?.editedMessage ) } - } +} /** * Extract the true message content from a message @@ -833,9 +833,9 @@ export const assertMediaContent = (content: proto.IMessage | null | undefined) = */ export const getPollUpdateMessage = async( msg: WAProto.IWebMessageInfo, - pollCreationData: { encKey: Uint8Array; sender: string; options: string[]; }, + pollCreationData: { encKey: Uint8Array, sender: string, options: string[] }, withSelectedOptions: boolean = false, -): Promise<{ hash: string[] } | { hash: string[]; selectedOptions: string[] }> => { +): Promise<{ hash: string[] } | { hash: string[], selectedOptions: string[] }> => { if(!msg.message?.pollUpdateMessage || !pollCreationData?.encKey) { throw new Boom('Missing pollUpdateMessage, or encKey', { statusCode: 400 }) }