From 95137f01e73dc665b2c12eb7cc303c43770b370d Mon Sep 17 00:00:00 2001 From: gekkedev <17025257+gekkedev@users.noreply.github.com> Date: Thu, 24 Oct 2024 23:39:22 +0200 Subject: [PATCH] docs: Grammar corrections (#2367) --- src/api/layers/host.layer.ts | 2 +- src/api/layers/listener.layer.ts | 38 ++++++++++++++--------------- src/api/model/get-messages-param.ts | 15 ++++++------ src/api/model/initializer.ts | 2 +- src/api/whatsapp.ts | 10 ++++---- 5 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/api/layers/host.layer.ts b/src/api/layers/host.layer.ts index ab8f6133a..f7bb0623e 100644 --- a/src/api/layers/host.layer.ts +++ b/src/api/layers/host.layer.ts @@ -484,7 +484,7 @@ export class HostLayer { } /** - * Retrieves the connecction state + * Retrieves the connection state * @category Host */ public async getConnectionState(): Promise { diff --git a/src/api/layers/listener.layer.ts b/src/api/layers/listener.layer.ts index 51e0898c7..154287791 100644 --- a/src/api/layers/listener.layer.ts +++ b/src/api/layers/listener.layer.ts @@ -397,7 +397,7 @@ export class ListenerLayer extends ProfileLayer { } /** - * @event Listens to messages acknowledgement Changes + * @event Listens to message acknowledgement changes * @returns Disposable object to stop the listening */ public onAck(callback: (ack: Ack) => void) { @@ -405,20 +405,20 @@ export class ListenerLayer extends ProfileLayer { } /** - * Escuta os eventos de Localização em tempo real de todos os chats - * @event Eventos de Localização em tempo real - * @param callback Função para ser executada quando houver alterações - * @returns Objeto descartável para parar de ouvir + * Listens to real-time location events of all chats + * @event Real-time location events + * @param callback Function to be executed when changes are made + * @returns Disposable object to stop listening */ public onLiveLocation(callback: (liveLocationEvent: LiveLocation) => void): { dispose: () => void; }; /** - * Escuta os eventos de Localização em tempo real - * @event Eventos de Localização em tempo real - * @param id Único ID ou lista de IDs de contatos para acompanhar a localização - * @param callback Função para ser executada quando houver alterações - * @returns Objeto descartável para parar de ouvir + * Listens to location events in real time + * @event Location events in real time + * @param id Unique ID or list of contact IDs to track location + * @param callback Function to be executed when changes are made + * @returns Disposable object to stop listening */ public onLiveLocation( id: string | string[], @@ -451,17 +451,17 @@ export class ListenerLayer extends ProfileLayer { } /** - * @event Listens to participants changed - * @param to callback + * @event Listens to participant changes + * @param callback Function to be executed when participant changes occur * @returns Stream of ParticipantEvent */ public onParticipantsChanged(callback: (evData: ParticipantEvent) => void): { dispose: () => void; }; /** - * @event Listens to participants changed - * @param to group id: xxxxx-yyyy@us.c - * @param to callback + * @event Listens to participant changes in a certain group + * @param groupId xxxxx-yyyy@us.c + * @param callback Function to be executed when participant changes occur * @returns Stream of ParticipantEvent */ public onParticipantsChanged( @@ -520,8 +520,8 @@ export class ListenerLayer extends ProfileLayer { callback: (presenceChangedEvent: PresenceEvent) => void ): { dispose: () => void }; /** - * Listens to presence changed, the callback will triggered only for passed IDs - * @event Listens to presence changed + * Listens to presence changes, the callback will triggered only for passed IDs + * @event Listens to presence changes * @param id contact id (xxxxx@c.us) or group id: xxxxx-yyyy@g.us * @param callback Callback of on presence changed * @returns Disposable object to stop the listening @@ -600,7 +600,7 @@ export class ListenerLayer extends ProfileLayer { } /** - * @event Listens to revoked messages + * @event Listens to message revocation * @returns Disposable object to stop the listening */ public onRevokedMessage( @@ -616,7 +616,7 @@ export class ListenerLayer extends ProfileLayer { } /** - * @event Listens to reaction messages + * @event Listens to message reactions * @returns Disposable object to stop the listening */ public onReactionMessage( diff --git a/src/api/model/get-messages-param.ts b/src/api/model/get-messages-param.ts index 5ccbaec51..347e01542 100644 --- a/src/api/model/get-messages-param.ts +++ b/src/api/model/get-messages-param.ts @@ -16,26 +16,25 @@ */ /** - * Parâmetros para retorno de mensagens + * Parameters for returning messages */ export interface GetMessagesParam { /** - * Quantidade de mensagens para retornar - * informar `-1` para trazer tudo (Pode demorar e travar a interface) + * Number of messages to return. + * Set it to `-1` to return everything (may take a while and crash the interface). * * @default 20 */ count?: number; /** - * ID da última mensagem para continuar a busca - * Isso funciona como paginação, então ao pegar um ID, - * você pode utilizar para obter as próximas mensagens a partir dele + * ID of the last message to continue the search. + * This works like pagination, so when you get an ID, + * you can use it to get the next messages from it. */ id?: string; fromMe?: boolean; /** - * Se você deseja recuperar as mensagems antes(before) ou depois(after) - * do ID informado. + * Whether you want to retrieve the messages before or after the ID entered. * * @default 'before' */ diff --git a/src/api/model/initializer.ts b/src/api/model/initializer.ts index 2113dae39..1728227c1 100644 --- a/src/api/model/initializer.ts +++ b/src/api/model/initializer.ts @@ -50,7 +50,7 @@ export interface CreateOptions extends CreateConfig { /** * You must pass a string type parameter, this parameter will be the name of the client's session. If the parameter is not passed, the section name will be "session". */ - session: string; + session?: string; /** * A callback will be received, informing the status of the qrcode */ diff --git a/src/api/whatsapp.ts b/src/api/whatsapp.ts index 385469ae3..962ff1d5c 100644 --- a/src/api/whatsapp.ts +++ b/src/api/whatsapp.ts @@ -86,7 +86,7 @@ export class Whatsapp extends BusinessLayer { /** * Download and returns the media content in base64 format - * @param messageId Message ou id + * @param messageId Message or id * @returns Base64 of media */ public async downloadMedia(messageId: string | Message): Promise { @@ -131,7 +131,7 @@ export class Whatsapp extends BusinessLayer { } /** - * Logout WhatsApp + * Log out of WhatsApp * @returns boolean */ public async logout() { @@ -174,7 +174,7 @@ export class Whatsapp extends BusinessLayer { } /** - * Get message by id + * Get a message by its ID * @param messageId string * @returns Message object */ @@ -203,7 +203,7 @@ export class Whatsapp extends BusinessLayer { /** * Decrypts message file * @param message Message object - * @returns Decrypted file buffer (null otherwise) + * @returns Decrypted file buffer (`null` otherwise) */ public async decryptFile(message: Message) { const mediaUrl = message.clientUrl || message.deprecatedMms3Url; @@ -212,7 +212,7 @@ export class Whatsapp extends BusinessLayer { if (!mediaUrl) throw new Error( - 'message is missing critical data needed to download the file.' + 'message is missing critical data (`mediaUrl`) needed to download the file.' ); let haventGottenImageYet = true; let res: any;