Skip to content

Commit

Permalink
Fixed array type syntax
Browse files Browse the repository at this point in the history
Array type syntax should be string[] not [string]
  • Loading branch information
Ali Shah Lakhani authored Feb 14, 2020
1 parent e85f7be commit fce549c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/api/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ declare module WAPI {
const sendMessage: (to: string, content: string) => void;
const reply: (to: string, content: string, quotedMsg: string | Message) => void;
const getGeneratedUserAgent: (userAgent?: string) => string;
const forwardMessages: (to: string, messages: string | [string | Message], skipMyMessages: boolean) => any;
const forwardMessages: (to: string, messages: string | (string | Message)[], skipMyMessages: boolean) => any;
const sendLocation: (to: string, lat: any, lng: any, loc: string) => void;
const addParticipant: (groupId: string, contactId: string) => void;
const removeParticipant: (groupId: string, contactId: string) => void;
const promoteParticipant: (groupId: string, contactId: string) => void;
const demoteParticipant: (groupId: string, contactId: string) => void;
const createGroup: (groupName: string, contactId: string|[string]) => void;
const createGroup: (groupName: string, contactId: string|string[]) => void;
const sendSeen: (to: string) => void;
const sendImage: (
base64: string,
Expand Down Expand Up @@ -79,7 +79,7 @@ declare module WAPI {
const getContact: (contactId: string) => Contact;
const checkNumberStatus: (contactId: string) => any;
const getChatById: (contactId: string) => Chat;
const deleteMessage: (contactId: string, messageId: [string] | string, revoke?: boolean) => any;
const deleteMessage: (contactId: string, messageId: string[] | string, revoke?: boolean) => any;
const sendContact: (to: string, contact: string | string[]) => any;
const simulateTyping: (to: string, on: boolean) => void;
const isConnected: () => Boolean;
Expand Down Expand Up @@ -647,7 +647,7 @@ export class Whatsapp {
* @param messageId
* @returns nothing
*/
public async deleteMessage(contactId: string, messageId: [string] | string, revoke?: boolean) {
public async deleteMessage(contactId: string, messageId: string[] | string, revoke?: boolean) {
return await this.page.evaluate(
({ contactId, messageId, revoke }) => WAPI.deleteMessage(contactId, messageId, revoke),
{ contactId, messageId, revoke }
Expand Down Expand Up @@ -732,7 +732,7 @@ export class Whatsapp {
* @param to group name: 'New group'
* @param contacts: A single contact id or an array of contact ids.
*/
public async createGroup(groupName:string,contacts:string|[string]){
public async createGroup(groupName:string,contacts:string|string[]){
return await this.page.evaluate(
({ groupName, contacts }) => {
WAPI.createGroup(groupName, contacts);
Expand Down Expand Up @@ -797,4 +797,4 @@ export class Whatsapp {
}
}

export { useragent } from '../config/puppeteer.config'
export { useragent } from '../config/puppeteer.config'

0 comments on commit fce549c

Please sign in to comment.