File size: 2,459 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
import { StreamInfo, StreamMode } from '@wppconnect/wa-js/dist/whatsapp/enums';
import { CreateConfig } from '../../config/create-config';
import { SessionToken } from '../../token-store';
import { StatusFind } from './enum';
/**
 * A callback will be received, informing the status of the qrcode
 */
export type CatchQRCallback = (qrCode: string, asciiQR: string, attempt: number, urlCode?: string) => void;
/**
 * A callback will be received, informing the customer's status
 */
export type StatusFindCallback = (status: StatusFind | keyof typeof StatusFind, session: string) => void;
/**
 * A callback will be received, informing data as percentage and loading screen message
 */
export type LoadingScreenCallback = (percent: number, message: string) => void;
/**
 * A callback will be received, informing the stream mode has changed
 */
export type OnStreamModeCallback = (mode: StreamMode) => void;
/**
 * A callback will be received, informing the stream info has changed
 */
export type OnStreamInfoCallback = (info: StreamInfo) => void;
/**
 * A callback will be received, informing a code to you connect
 */
export type LinkByCodeCallback = (code: string) => void;
export interface CreateOptions extends CreateConfig {
    /**
     * You must pass a string type parameter, this parameter will be the name of the client's session. If the parameter is not passed, the section name will be "session".
     */
    session?: string;
    /**
     * A callback will be received, informing the status of the qrcode
     */
    catchQR?: CatchQRCallback;
    /**
     * A callback will be received, informing a code to you connect
     */
    catchLinkCode?: LinkByCodeCallback;
    /**
     * A callback will be received, informing the customer's status
     */
    statusFind?: StatusFindCallback;
    /**
     * A callback will be received, informing data as percentage and loading screen message
     */
    onLoadingScreen?: LoadingScreenCallback;
    /**
     * A callback will be received, informing the stream mode has changed
     */
    onStreamModeChanged?: OnStreamModeCallback;
    /**
     * A callback will be received, informing the stream info has changed
     */
    onStreamInfoChanged?: OnStreamInfoCallback;
    /**
     * Pass the session token information you can receive this token with the await client.getSessionTokenBrowser () function
     * @deprecated in favor of `sessionToken`
     */
    browserSessionToken?: SessionToken;
}