UNPKG

wa.ts

Version:

A simple Node.js library for simplifying WhatsApp Web socket connection using the WhiskeySockets/Baileys library.

20 lines (19 loc) 856 B
/// <reference types="node" /> import makeWASocket from '@whiskeysockets/baileys'; import { BaileysEventMap } from '@whiskeysockets/baileys/lib/Types'; import EventEmitter from 'events'; import { WhatsAppAPIOptions } from './types'; import { Message } from './types/message'; export declare class WhatsAppAPI extends EventEmitter { socket: ReturnType<typeof makeWASocket> | undefined; options: WhatsAppAPIOptions | undefined; path: string; constructor(options?: WhatsAppAPIOptions); initialize(): Promise<void>; restart(): void; connectionUpdate(update: BaileysEventMap['connection.update']): void; message(update: BaileysEventMap['messages.upsert']): void; reply(message: Message, text: string): Promise<void>; sendText(to: string, message: string): Promise<void>; checkNumber(number: string): Promise<void>; }