import { SessionRegistry } from '../core/session-registry'; import { MessageOptions } from '../types'; import { Session } from '../core/session'; type MediaPayload = { url?: string; buffer?: Buffer; mimetype?: string; caption?: string; fileName?: string; }; /** * Format nomor telepon atau group ID ke JID WhatsApp * * Sangat fleksibel - menerima berbagai format input: * * PHONE NUMBERS: * - '08123456789' -> '628123456789@s.whatsapp.net' * - '628123456789' -> '628123456789@s.whatsapp.net' * - '+62 812-3456-789' -> '628123456789@s.whatsapp.net' * - '628123456789@s.whatsapp.net' -> unchanged * * GROUPS: * - '123456789-1234567890' -> '123456789-1234567890@g.us' (auto-detect) * - '120363xxx@g.us' -> unchanged * - formatJid('123456789', true) -> '123456789@g.us' * * LINKED ID (LID): * - '188630735790116@lid' -> unchanged * - '188630735790116' with isLid=true -> '188630735790116@lid' * * BROADCAST: * - 'status@broadcast' -> unchanged * * @param input - Nomor telepon, group ID, LID, atau JID lengkap * @param isGroup - Force sebagai group (default: auto-detect) * @param isLid - Force sebagai LID (default: false) * @returns JID yang sudah diformat */ export declare function formatJid(input: string, isGroup?: boolean, isLid?: boolean): string; /** * Smart format JID - tries to determine the best format automatically * Use this when you're not sure what type of JID you have */ export declare function smartFormatJid(input: string): string; /** * Format array of JIDs */ export declare function formatJids(inputs: string[], isGroup?: boolean, isLid?: boolean): string[]; /** * Resolve a session from registry or throw descriptive error. */ export declare function getSessionOrThrow(registry: SessionRegistry, sessionId: string): Session; /** * Resolve socket from session or throw. */ export declare function getSocketOrThrow(session: Session): any; /** * Send text via registry * @param jid - Nomor telepon atau JID (akan di-format otomatis) */ export declare function sendText(registry: SessionRegistry, sessionId: string, jid: string, text: string, options?: Partial): Promise; /** * Send media via registry * @param jid - Nomor telepon atau JID (akan di-format otomatis) */ export declare function sendMedia(registry: SessionRegistry, sessionId: string, jid: string, media: MediaPayload): Promise; /** * Create a new WhatsApp group * @param participantJids - Array nomor telepon atau JID (akan di-format otomatis) */ export declare function createGroup(registry: SessionRegistry, sessionId: string, subject: string, participantJids: string[]): Promise; type GroupAction = 'add' | 'remove' | 'promote' | 'demote'; /** * Update participants of an existing group * @param groupJid - Group ID atau JID (akan di-format otomatis) * @param participantJids - Array nomor telepon atau JID (akan di-format otomatis) */ export declare function updateGroupParticipants(registry: SessionRegistry, sessionId: string, groupJid: string, participantJids: string[], action: GroupAction): Promise; /** * Check if a phone number is registered on WhatsApp */ export declare function checkNumberStatus(registry: SessionRegistry, sessionId: string, phoneNumber: string): Promise<{ exists: boolean; jid: string; }>; /** * Check multiple numbers at once */ export declare function checkNumbersStatus(registry: SessionRegistry, sessionId: string, phoneNumbers: string[]): Promise>; /** * Get profile picture URL */ export declare function getProfilePicture(registry: SessionRegistry, sessionId: string, jid: string, highRes?: boolean): Promise; /** * Get contact info */ export declare function getContactInfo(registry: SessionRegistry, sessionId: string, jid: string): Promise<{ jid: string; name?: string; notify?: string; verifiedName?: string; status?: string; imgUrl?: string; }>; /** * Send location message */ export declare function sendLocation(registry: SessionRegistry, sessionId: string, jid: string, latitude: number, longitude: number, options?: { name?: string; address?: string; }): Promise; /** * Send contact/vCard */ export declare function sendContact(registry: SessionRegistry, sessionId: string, jid: string, contact: { name: string; phone: string; }): Promise; /** * Send multiple contacts */ export declare function sendContacts(registry: SessionRegistry, sessionId: string, jid: string, contacts: Array<{ name: string; phone: string; }>): Promise; /** * Send reaction to a message */ export declare function sendReaction(registry: SessionRegistry, sessionId: string, jid: string, messageId: string, emoji: string): Promise; /** * Remove reaction from a message */ export declare function removeReaction(registry: SessionRegistry, sessionId: string, jid: string, messageId: string): Promise; /** * Send poll */ export declare function sendPoll(registry: SessionRegistry, sessionId: string, jid: string, name: string, options: string[], selectableCount?: number): Promise; /** * Send button message (deprecated in WhatsApp, may not work) */ export declare function sendButtons(registry: SessionRegistry, sessionId: string, jid: string, text: string, buttons: Array<{ id: string; text: string; }>, footer?: string): Promise; /** * Send list message */ export declare function sendList(registry: SessionRegistry, sessionId: string, jid: string, title: string, text: string, buttonText: string, sections: Array<{ title: string; rows: Array<{ id: string; title: string; description?: string; }>; }>, footer?: string): Promise; /** * Mark message as read */ export declare function markAsRead(registry: SessionRegistry, sessionId: string, jid: string, messageIds: string[]): Promise; /** * Send presence update (typing, recording, online, offline) */ export declare function sendPresence(registry: SessionRegistry, sessionId: string, jid: string | null, presence: 'available' | 'unavailable' | 'composing' | 'recording' | 'paused'): Promise; /** * Get group metadata */ export declare function getGroupInfo(registry: SessionRegistry, sessionId: string, groupId: string): Promise<{ id: string; subject: string; description?: string; owner?: string; creation?: number; participants: Array<{ id: string; admin?: 'admin' | 'superadmin'; }>; announce?: boolean; restrict?: boolean; }>; /** * Update group subject (name) */ export declare function updateGroupSubject(registry: SessionRegistry, sessionId: string, groupId: string, subject: string): Promise; /** * Update group description */ export declare function updateGroupDescription(registry: SessionRegistry, sessionId: string, groupId: string, description: string): Promise; /** * Update group settings */ export declare function updateGroupSettings(registry: SessionRegistry, sessionId: string, groupId: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked'): Promise; /** * Leave a group */ export declare function leaveGroup(registry: SessionRegistry, sessionId: string, groupId: string): Promise; /** * Get group invite code */ export declare function getGroupInviteCode(registry: SessionRegistry, sessionId: string, groupId: string): Promise; /** * Revoke group invite code */ export declare function revokeGroupInviteCode(registry: SessionRegistry, sessionId: string, groupId: string): Promise; /** * Join group via invite code */ export declare function joinGroupViaCode(registry: SessionRegistry, sessionId: string, inviteCode: string): Promise; /** * Block a contact */ export declare function blockContact(registry: SessionRegistry, sessionId: string, jid: string): Promise; /** * Unblock a contact */ export declare function unblockContact(registry: SessionRegistry, sessionId: string, jid: string): Promise; /** * Update profile status */ export declare function updateProfileStatus(registry: SessionRegistry, sessionId: string, status: string): Promise; /** * Update profile name */ export declare function updateProfileName(registry: SessionRegistry, sessionId: string, name: string): Promise; /** * Get all chats */ export declare function getChats(registry: SessionRegistry, sessionId: string): Promise; /** * Archive a chat */ export declare function archiveChat(registry: SessionRegistry, sessionId: string, jid: string, archive?: boolean): Promise; /** * Mute a chat */ export declare function muteChat(registry: SessionRegistry, sessionId: string, jid: string, muteEndTime: number | null): Promise; /** * Pin a chat */ export declare function pinChat(registry: SessionRegistry, sessionId: string, jid: string, pin?: boolean): Promise; /** * Star a message */ export declare function starMessage(registry: SessionRegistry, sessionId: string, jid: string, messageId: string, star?: boolean): Promise; /** * Delete message for me */ export declare function deleteMessage(registry: SessionRegistry, sessionId: string, jid: string, messageId: string, forEveryone?: boolean): Promise; /** * Forward a message */ export declare function forwardMessage(registry: SessionRegistry, sessionId: string, jid: string, message: any, forceForward?: boolean): Promise; /** * Get business profile */ export declare function getBusinessProfile(registry: SessionRegistry, sessionId: string, jid: string): Promise; export {}; //# sourceMappingURL=wrapper.helpers.d.ts.map