Skip to content

Commit

Permalink
docs: Grammar corrections (#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
gekkedev authored Oct 24, 2024
1 parent f0f0406 commit 95137f0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/api/layers/host.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export class HostLayer {
}

/**
* Retrieves the connecction state
* Retrieves the connection state
* @category Host
*/
public async getConnectionState(): Promise<SocketState> {
Expand Down
38 changes: 19 additions & 19 deletions src/api/layers/listener.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,28 +397,28 @@ 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) {
return this.registerEvent(ExposedFn.onAck, callback);
}

/**
* 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[],
Expand Down Expand Up @@ -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: [email protected]
* @param to callback
* @event Listens to participant changes in a certain group
* @param groupId [email protected]
* @param callback Function to be executed when participant changes occur
* @returns Stream of ParticipantEvent
*/
public onParticipantsChanged(
Expand Down Expand Up @@ -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 ([email protected]) or group id: [email protected]
* @param callback Callback of on presence changed
* @returns Disposable object to stop the listening
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
15 changes: 7 additions & 8 deletions src/api/model/get-messages-param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/model/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
10 changes: 5 additions & 5 deletions src/api/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
Expand Down Expand Up @@ -131,7 +131,7 @@ export class Whatsapp extends BusinessLayer {
}

/**
* Logout WhatsApp
* Log out of WhatsApp
* @returns boolean
*/
public async logout() {
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 95137f0

Please sign in to comment.