File size: 5,207 Bytes
9844ee9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { EditMessageOptions } from '@wppconnect/wa-js/dist/chat/functions/editMessage';
import { MsgKey } from '@wppconnect/wa-js/dist/whatsapp';
import { Page } from 'puppeteer';
import { CreateConfig } from '../../config/create-config';
import { UILayer } from './ui.layer';
import { Message } from '../model';
export declare class ControlsLayer extends UILayer {
    page: Page;
    constructor(page: Page, session?: string, options?: CreateConfig);
    /**
     * Unblock contact
     * @category Blocklist
     * @param contactId {string} id '000000000000@c.us'
     * @returns boolean
     */
    unblockContact(contactId: string): Promise<boolean>;
    /**
     * Block contact
     * @category Blocklist
     * @param contactId {string} id '000000000000@c.us'
     * @returns boolean
     */
    blockContact(contactId: string): Promise<boolean>;
    /**
     * puts the chat as unread
     * @category Chat
     * @param contactId {string} id '000000000000@c.us'
     * @returns boolean
     */
    markUnseenMessage(contactId: string): Promise<boolean>;
    /**
     * Deletes the given chat
     * @category Chat
     * @param chatId {string} id '000000000000@c.us'
     * @returns boolean
     */
    deleteChat(chatId: string): Promise<boolean>;
    /**
     * Archive and unarchive chat messages with true or false
     * @category Chat
     * @param chatId {string} id '000000000000@c.us'
     * @param option {boolean} true or false
     * @returns boolean
     */
    archiveChat(chatId: string, option?: boolean): Promise<{
        wid: import("@wppconnect/wa-js/dist/whatsapp").Wid;
        archive: boolean;
    }>;
    /**
     * Pin and Unpin chat messages with true or false
     * @category Chat
     * @param chatId {string} id '000000000000@c.us'
     * @param option {boolean} true or false
     * @param nonExistent {boolean} Pin chat, non-existent (optional)
     * @returns object
     */
    pinChat(chatId: string, option: boolean, nonExistent?: boolean): Promise<{
        wid: import("@wppconnect/wa-js/dist/whatsapp").Wid;
        pin: boolean;
    }>;
    /**
     * Deletes all messages of given chat
     * @category Chat
     * @param chatId
     * @param keepStarred Keep starred messages
     * @returns boolean
     */
    clearChat(chatId: string, keepStarred?: boolean): Promise<boolean>;
    /**
     * Deletes message of given message id
     * @category Chat
     * @param chatId The chat id from which to delete the message.
     * @param messageId The specific message id of the message to be deleted
     * @param onlyLocal If it should only delete locally (message remains on the other recipienct's phone). Defaults to false.
     */
    deleteMessage(chatId: string, messageId: string[] | string, onlyLocal?: boolean, deleteMediaInDevice?: boolean): Promise<boolean>;
    /**
     * Edits message of given message id
     * @category Chat
     * @param msgId The specific message id of the message to be edited
     * @param newText New content of specified message
     * @param options Common message options
     *
     * @example
     * ```javascript
     * // Simple message
     * client.editMessage('true_<number>@c.us_messageId', 'new Text For Simple Message');
     * ```
     */
    editMessage(msgId: string | MsgKey, newText: string, options?: EditMessageOptions): Promise<Message>;
    /**
     * Stars message of given message id
     * @category Chat
     * @param messagesId The specific message id of the message to be starred
     * @param star Add or remove star of the message. Defaults to true.
     */
    starMessage(messagesId: string[] | string, star?: boolean): Promise<number>;
    /**
     * Allow only admin to send messages with true or false
     * @category Group
     * @param chatId {string} id '000000000000@c.us'
     * @param option {boolean} true or false
     * @returns boolean
     */
    setMessagesAdminsOnly(chatId: string, option: boolean): Promise<boolean>;
    /**
     * Enable or disable temporary messages with true or false
     * @category Chat
     * @param chatOrGroupId id '000000000000@c.us' or '000000-000000@g.us'
     * @param value true or false
     * @returns boolean
     */
    setTemporaryMessages(chatOrGroupId: string, value: boolean): Promise<boolean>;
    /**
     * Change limits of whatsapp web
     *  * @example
     * ```javascript
     *  //Change the maximum size (bytes) for uploading media (max 70MB)
     *  WPP.conn.setLimit('maxMediaSize',16777216);
     *
     *  //Change the maximum size (bytes) for uploading files (max 1GB)
     *  WPP.conn.setLimit('maxFileSize',104857600);
     *
     *  //Change the maximum number of contacts that can be selected when sharing (Default 5)
     *  WPP.conn.setLimit('maxShare',100);
     *
     *  //Change the maximum time (seconds) of a video status
     *  WPP.conn.setLimit('statusVideoMaxDuration',120);
     *
     *  //Remove pinned conversation limit (only whatsapp web) (Default 3)
     *  WPP.conn.setLimit('unlimitedPin',true);
     * ```
     * @category Chat
     */
    setLimit(key: 'maxMediaSize' | 'maxFileSize' | 'maxShare' | 'statusVideoMaxDuration' | 'unlimitedPin', value: boolean | number): Promise<number>;
}