import { Page } from 'puppeteer'; import { CreateConfig } from '../../config/create-config'; import { Id, Wid } from '../model'; import { GroupProperty } from '../model/enum'; import { RetrieverLayer } from './retriever.layer'; export declare class GroupLayer extends RetrieverLayer { page: Page; constructor(page: Page, session?: string, options?: CreateConfig); /** * Removes the host device from the group * @category Group * @param groupId group id */ leaveGroup(groupId: string): Promise; /** * Retrieves group members as [Id] objects * @category Group * @param groupId group id */ getGroupMembersIds(groupId: string): Promise; /** * Returns group members [Contact] objects * @category Group * @param groupId */ getGroupMembers(groupId: string): Promise; /** * Generates group-invite link * @category Group * @param chatId * @returns Invitation link */ getGroupInviteLink(chatId: string): Promise; /** * Revokes group-invite link and generate new one. * @category Group * @param chatId * @returns Invitation link */ revokeGroupInviteLink(chatId: string): Promise; /** * Generates group-invite link * @category Group * @param inviteCode * @returns Invite code from group link. Example: CMJYfPFqRyE2GxrnkldYED */ getGroupInfoFromInviteLink(inviteCode: string): Promise<{ descOwner: string; id: string; owner: string; participants: { id: string; isAdmin: boolean; isSuperAdmin: boolean; }[]; subjectOwner: string; announce: boolean; creation: number; desc: string; descId: string; descTime: number; noFrequentlyForwarded: boolean; parent: boolean; pvId?: string; restrict: boolean; size: number; status: number; subject: string; subjectTime: number; support: boolean; suspended: boolean; }>; /** * Creates a new chat group * @category Group * @param groupName Group name * @param contacts Contacts that should be added. */ createGroup(groupName: string, contacts: string | string[]): Promise<{ gid: import("project-wajs-dv/dist/whatsapp").Wid; participants: { [key: `${number}@c.us`]: { wid: string; code: number; invite_code: string; invite_code_exp: number; }; }; }>; /** * Removes participant from group * @category Group * @param groupId Chat id ('0000000000-00000000@g.us') * @param participantId Participant id'000000000000@c.us' */ removeParticipant(groupId: string, participantId: string | string[]): Promise; /** * Adds participant to Group * @category Group * @param groupId Chat id ('0000000000-00000000@g.us') * @param participantId Participant id'000000000000@c.us' */ addParticipant(groupId: string, participantId: string | string[]): Promise<{ [key: `${number}@c.us`]: { wid: string; code: number; message: string; invite_code: string; invite_code_exp: number; }; }>; /** * Promotes participant as Admin in given group * @category Group * @param groupId Chat id ('0000000000-00000000@g.us') * @param participantId Participant id'000000000000@c.us' */ promoteParticipant(groupId: string, participantId: string | string[]): Promise; /** * Demotes admin privileges of participant * @category Group * @param groupId Chat id ('0000000000-00000000@g.us') * @param participantId Participant id'000000000000@c.us' */ demoteParticipant(groupId: string, participantId: string | string[]): Promise; /** * Retrieves group admins * @category Group * @param chatId Group/Chat id ('0000000000-00000000@g.us') */ getGroupAdmins(chatId: string): Promise; /** * Join a group with invite code * @category Group * @param inviteCode */ joinGroup(inviteCode: string): Promise<{ id: string; }>; /** * Set group description (if allowed) * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param description New group description * @returns empty object */ setGroupDescription(groupId: string, description: string): Promise; /** * Set group subject (if allowed) * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param title New group subject * @returns empty object */ setGroupSubject(groupId: string, title: string): Promise; /** * Enable or disable group properties, see {@link GroupProperty for details} * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param property * @param value true or false * @returns empty object */ setGroupProperty(groupId: string, property: GroupProperty, value: boolean): Promise; /** * Set group icon * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param base64 Image in base64 ( data:image/jpeg;base64,..... ) * @returns empty object */ setGroupIcon(groupId: string, pathOrBase64: string): Promise<{ eurl: string; status: number; tag: string; token: string; _duplicate: boolean; }>; /** * Set group subject (if allowed) * @category Group * @param groupId Group ID ('0000000000@g.us') * @returns empty object */ removeGroupIcon(groupId: string): Promise; /** * Get the max number of participants for a group * @category Group * @returns number */ getGroupSizeLimit(): Promise; /** * Approve a membership request to group * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param wid @c.us * @returns Promise */ approveGroupMembershipRequest(groupId: string, membershipIds: string | string[]): Promise<{ error: any; wid: Wid; }[]>; /** * Reject a membership request to group * @category Group * @param groupId Group ID ('000000-000000@g.us') * @param wid @c.us * @returns Promise */ rejectGroupMembershipRequest(groupId: string, membershipIds: string | string[]): Promise<{ error: any; wid: Wid; }[]>; /** * Retrieve a list of a membership approval requests * @category Group * @param groupId Group ID ('000000-000000@g.us') * @returns Promise */ getGroupMembershipRequests(groupId: string): Promise<{ addedBy: Wid; id: Wid; parentGroupId?: Wid; requestMethod: 'InviteLink' | 'LinkedGroupJoin' | 'NonAdminAdd'; t: number; }[]>; }