@open-wa/wa-automate-types-only 4.30.12 → 4.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/Client.d.ts +39 -41
- package/dist/api/model/aliases.d.ts +10 -6
- package/dist/api/model/config.d.ts +4 -1
- package/dist/api/model/index.d.ts +1 -0
- package/dist/api/model/product.d.ts +1 -1
- package/dist/controllers/auth.d.ts +5 -1
- package/dist/controllers/script_preloader.d.ts +17 -0
- package/package.json +1 -1
package/dist/api/Client.d.ts
CHANGED
@@ -74,7 +74,7 @@ export declare class Client {
|
|
74
74
|
* A convinience method to download the [[DataURL]] of a file
|
75
75
|
* @param url The url
|
76
76
|
* @param optionsOverride You can use this to override the [axios request config](https://github.com/axios/axios#request-config)
|
77
|
-
* @returns Promise<DataURL
|
77
|
+
* @returns `Promise<DataURL>`
|
78
78
|
*/
|
79
79
|
download(url: string, optionsOverride?: any): Promise<DataURL>;
|
80
80
|
/**
|
@@ -239,7 +239,8 @@ export declare class Client {
|
|
239
239
|
*
|
240
240
|
* Here is an example of the fired object:
|
241
241
|
*
|
242
|
-
* @fires
|
242
|
+
* @fires
|
243
|
+
* ```javascript
|
243
244
|
* {
|
244
245
|
* "chat": "00000000000-1111111111@g.us", //the chat in which this state is occuring
|
245
246
|
* "user": "22222222222@c.us", //the user that is causing this state
|
@@ -315,9 +316,17 @@ export declare class Client {
|
|
315
316
|
* @param chatId the chat from which you want to subscribes to live location updates
|
316
317
|
* @param fn callback that takes in a LiveLocationChangedEvent
|
317
318
|
* @returns boolean, if returns false then there were no valid live locations in the chat of chatId
|
318
|
-
* @emits
|
319
|
+
* @emits `<LiveLocationChangedEvent>` LiveLocationChangedEvent
|
319
320
|
*/
|
320
321
|
onLiveLocation(chatId: ChatId, fn: (liveLocationChangedEvent: LiveLocationChangedEvent) => void): Promise<boolean>;
|
322
|
+
/**
|
323
|
+
* Use this simple command to test firing callback events.
|
324
|
+
*
|
325
|
+
* @param callbackToTest
|
326
|
+
* @param testData
|
327
|
+
* @returns `false` if the callback was not registered/does not exist
|
328
|
+
*/
|
329
|
+
testCallback(callbackToTest: SimpleListener, testData: any): Promise<boolean>;
|
321
330
|
/**
|
322
331
|
* Set presence to available or unavailable.
|
323
332
|
* @param available if true it will set your presence to 'online', false will set to unavailable (i.e no 'online' on recipients' phone);
|
@@ -428,7 +437,7 @@ export declare class Client {
|
|
428
437
|
* A list of participants in the chat who have their live location on. If the chat does not exist, or the chat does not have any contacts actively sharing their live locations, it will return false. If it's a chat with a single contact, there will be only 1 value in the array if the contact has their livelocation on.
|
429
438
|
* Please note. This should only be called once every 30 or so seconds. This forces the phone to grab the latest live location data for the number. This can be used in conjunction with onLiveLocation (this will trigger onLiveLocation).
|
430
439
|
* @param chatId string Id of the chat you want to force the phone to get the livelocation data for.
|
431
|
-
* @returns Promise<LiveLocationChangedEvent []
|
440
|
+
* @returns `Promise<LiveLocationChangedEvent []>` | boolean
|
432
441
|
*/
|
433
442
|
forceUpdateLiveLocation(chatId: ChatId): Promise<LiveLocationChangedEvent[] | boolean>;
|
434
443
|
private link;
|
@@ -482,6 +491,8 @@ export declare class Client {
|
|
482
491
|
*/
|
483
492
|
sendBanner(to: ChatId, base64: Base64): Promise<boolean | MessageId>;
|
484
493
|
/**
|
494
|
+
* {@license:insiders@}
|
495
|
+
* <span theme="badge contrast license">Insiders</span>
|
485
496
|
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
486
497
|
*
|
487
498
|
* Send a list message. This will not work when being sent from business accounts!
|
@@ -511,7 +522,7 @@ export declare class Client {
|
|
511
522
|
* @param groupId group chat id: `xxxxx@g.us`
|
512
523
|
* @param content text message to add under all of the tags
|
513
524
|
* @param hideTags Removes all tags within the message
|
514
|
-
* @returns Promise<MessageId
|
525
|
+
* @returns `Promise<MessageId>`
|
515
526
|
*/
|
516
527
|
tagEveryone(groupId: GroupChatId, content: Content, hideTags?: boolean): Promise<boolean | MessageId>;
|
517
528
|
/**
|
@@ -542,7 +553,7 @@ export declare class Client {
|
|
542
553
|
/**
|
543
554
|
* Decrypts a media message.
|
544
555
|
* @param message This can be the serialized [[MessageId]] or the whole [[Message]] object. It is advised to just use the serialized message ID.
|
545
|
-
* @returns Promise<[[DataURL]]
|
556
|
+
* @returns `Promise<[[DataURL]]>`
|
546
557
|
*/
|
547
558
|
decryptMedia(message: Message | MessageId): Promise<DataURL>;
|
548
559
|
/**
|
@@ -553,7 +564,7 @@ export declare class Client {
|
|
553
564
|
* @param caption string xxxxx
|
554
565
|
* @param waitForKey boolean default: false set this to true if you want to wait for the id of the message. By default this is set to false as it will take a few seconds to retrieve to the key of the message and this waiting may not be desirable for the majority of users.
|
555
566
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
556
|
-
* @returns Promise <boolean | string
|
567
|
+
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
557
568
|
*/
|
558
569
|
sendImage(to: ChatId, file: DataURL | FilePath, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
|
559
570
|
/**
|
@@ -580,7 +591,7 @@ export declare class Client {
|
|
580
591
|
* @param content string reply text
|
581
592
|
* @param quotedMsgId string the msg id to reply to.
|
582
593
|
* @param sendSeen boolean If set to true, the chat will 'blue tick' all messages before sending the reply
|
583
|
-
* @returns Promise<MessageId | false
|
594
|
+
* @returns `Promise<MessageId | false>` false if didn't work, otherwise returns message id.
|
584
595
|
*/
|
585
596
|
reply(to: ChatId, content: Content, quotedMsgId: MessageId, sendSeen?: boolean): Promise<boolean | MessageId>;
|
586
597
|
/**
|
@@ -591,7 +602,7 @@ export declare class Client {
|
|
591
602
|
* This will only work if you have chats sent back and forth between you and the contact 1-1.
|
592
603
|
*
|
593
604
|
* @param contactId The Id of the contact with which you have an existing conversation with messages already.
|
594
|
-
* @returns Promise<string | boolean
|
605
|
+
* @returns `Promise<string | boolean>` true or false or a string with an explaintaion of why it wasn't able to determine the read receipts.
|
595
606
|
*
|
596
607
|
*/
|
597
608
|
checkReadReceipts(contactId: ContactId): Promise<string | boolean>;
|
@@ -612,7 +623,7 @@ export declare class Client {
|
|
612
623
|
* @param ptt boolean default: false set this to true if you want to send the file as a push to talk file.
|
613
624
|
* @param withoutPreview boolean default: false set this to true if you want to send the file without a preview (i.e as a file). This is useful for preventing auto downloads on recipient devices.
|
614
625
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
615
|
-
* @returns Promise <boolean | MessageId
|
626
|
+
* @returns `Promise <boolean | MessageId>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
616
627
|
*/
|
617
628
|
sendFile(to: ChatId, file: DataURL | FilePath, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
|
618
629
|
/**
|
@@ -620,7 +631,7 @@ export declare class Client {
|
|
620
631
|
*
|
621
632
|
* Checks whether or not the group id provided is known to be unsafe by the contributors of the library.
|
622
633
|
* @param groupChatId The group chat you want to deteremine is unsafe
|
623
|
-
* @returns Promise <boolean | string
|
634
|
+
* @returns `Promise <boolean | string>` This will either return a boolean indiciating whether this group chat id is considered unsafe or an error message as a string
|
624
635
|
*/
|
625
636
|
isGroupIdUnsafe(groupChatId: GroupChatId): Promise<string | boolean>;
|
626
637
|
/**
|
@@ -628,7 +639,7 @@ export declare class Client {
|
|
628
639
|
* @param to chat id `xxxxx@c.us`
|
629
640
|
* @param file base64 data:image/xxx;base64,xxx or the path of the file you want to send.
|
630
641
|
* @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
|
631
|
-
* @returns Promise <boolean | string
|
642
|
+
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
632
643
|
*/
|
633
644
|
sendPtt(to: ChatId, file: DataURL | FilePath, quotedMsgId: MessageId): Promise<MessageId>;
|
634
645
|
/**
|
@@ -674,7 +685,7 @@ export declare class Client {
|
|
674
685
|
getMe(): Promise<any>;
|
675
686
|
/**
|
676
687
|
* Returns a PNG DataURL screenshot of the session
|
677
|
-
* @returns Promise<DataURL
|
688
|
+
* @returns `Promise<DataURL>`
|
678
689
|
*/
|
679
690
|
getSnapshot(): Promise<DataURL>;
|
680
691
|
/**
|
@@ -793,7 +804,7 @@ export declare class Client {
|
|
793
804
|
* Any potential abuse of this method will see it become paywalled.
|
794
805
|
* @param to: Chat id to forward the message to
|
795
806
|
* @param messageId: message id of the message to forward. Please note that if it is not loaded, this will return false - even if it exists.
|
796
|
-
* @returns Promise<MessageId | boolean
|
807
|
+
* @returns `Promise<MessageId | boolean>`
|
797
808
|
*/
|
798
809
|
ghostForward(to: ChatId, messageId: MessageId): Promise<MessageId | boolean>;
|
799
810
|
/**
|
@@ -861,7 +872,7 @@ export declare class Client {
|
|
861
872
|
getAllChatIds(): Promise<ChatId[]>;
|
862
873
|
/**
|
863
874
|
* retrieves an array of IDs of accounts blocked by the host account.
|
864
|
-
* @returns Promise<ChatId[]
|
875
|
+
* @returns `Promise<ChatId[]>`
|
865
876
|
*/
|
866
877
|
getBlockedIds(): Promise<ChatId[]>;
|
867
878
|
/**
|
@@ -900,7 +911,7 @@ export declare class Client {
|
|
900
911
|
* @param returnChatObj boolean When this is set to true and if the group was joined successfully, it will return a serialzed Chat object which includes group information and metadata. This is useful when you want to immediately do something with group metadata.
|
901
912
|
*
|
902
913
|
*
|
903
|
-
* @returns Promise<string | boolean | number
|
914
|
+
* @returns `Promise<string | boolean | number>` Either false if it didn't work, or the group id.
|
904
915
|
*/
|
905
916
|
joinGroupViaLink(link: string, returnChatObj?: boolean): Promise<string | boolean | number | Chat>;
|
906
917
|
/**
|
@@ -1165,7 +1176,7 @@ export declare class Client {
|
|
1165
1176
|
/**
|
1166
1177
|
* Retrieves an invite link for a group chat. returns false if chat is not a group.
|
1167
1178
|
* @param chatId
|
1168
|
-
* @returns Promise<string
|
1179
|
+
* @returns `Promise<string>`
|
1169
1180
|
*/
|
1170
1181
|
getGroupInviteLink(chatId: ChatId): Promise<string>;
|
1171
1182
|
/**
|
@@ -1177,7 +1188,7 @@ export declare class Client {
|
|
1177
1188
|
/**
|
1178
1189
|
* Revokes the current invite link for a group chat. Any previous links will stop working
|
1179
1190
|
* @param chatId
|
1180
|
-
* @returns Promise<boolean
|
1191
|
+
* @returns `Promise<boolean>`
|
1181
1192
|
*/
|
1182
1193
|
revokeGroupInviteLink(chatId: ChatId): Promise<boolean | string>;
|
1183
1194
|
/**
|
@@ -1200,7 +1211,9 @@ export declare class Client {
|
|
1200
1211
|
* @param use_unread_count
|
1201
1212
|
* @returns any
|
1202
1213
|
*/
|
1203
|
-
getUnreadMessages(includeMe: boolean, includeNotifications: boolean, use_unread_count: boolean): Promise<
|
1214
|
+
getUnreadMessages(includeMe: boolean, includeNotifications: boolean, use_unread_count: boolean): Promise<Chat & {
|
1215
|
+
messages: Message[];
|
1216
|
+
}>;
|
1204
1217
|
/**
|
1205
1218
|
* Retrieves all new Messages. where isNewMsg==true
|
1206
1219
|
* @returns list of messages
|
@@ -1252,21 +1265,6 @@ export declare class Client {
|
|
1252
1265
|
*
|
1253
1266
|
* @param groupName group name: 'New group'
|
1254
1267
|
* @param contacts: A single contact id or an array of contact ids.
|
1255
|
-
* @returns Promise<GroupCreationResponse> :
|
1256
|
-
* ```javascript
|
1257
|
-
* {
|
1258
|
-
* status: 200,
|
1259
|
-
* gid: {
|
1260
|
-
* server: 'g.us',
|
1261
|
-
* user: '447777777777-1583678870',
|
1262
|
-
* _serialized: '447777777777-1583678870@g.us'
|
1263
|
-
* },
|
1264
|
-
* participants: [
|
1265
|
-
* { '447777777777@c.us': [Object] },
|
1266
|
-
* { '447444444444@c.us': [Object] }
|
1267
|
-
* ]
|
1268
|
-
* }
|
1269
|
-
* ```
|
1270
1268
|
*/
|
1271
1269
|
createGroup(groupName: string, contacts: ContactId | ContactId[]): Promise<GroupChatCreationResponse>;
|
1272
1270
|
/**
|
@@ -1416,7 +1414,7 @@ export declare class Client {
|
|
1416
1414
|
* @param url: The url of the image
|
1417
1415
|
* @param requestConfig {} By default the request is a get request, however you can override that and many other options by sending this parameter. You can read more about this parameter here: https://github.com/axios/axios#request-config
|
1418
1416
|
*
|
1419
|
-
* @returns Promise<MessageId | boolean
|
1417
|
+
* @returns `Promise<MessageId | boolean>`
|
1420
1418
|
*/
|
1421
1419
|
sendStickerfromUrl(to: ChatId, url: string, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<string | MessageId | boolean>;
|
1422
1420
|
/**
|
@@ -1428,7 +1426,7 @@ export declare class Client {
|
|
1428
1426
|
* @param messageId The id of the message to reply to
|
1429
1427
|
* @param requestConfig {} By default the request is a get request, however you can override that and many other options by sending this parameter. You can read more about this parameter here: https://github.com/axios/axios#request-config
|
1430
1428
|
*
|
1431
|
-
* @returns Promise<MessageId | boolean
|
1429
|
+
* @returns `Promise<MessageId | boolean>`
|
1432
1430
|
*/
|
1433
1431
|
sendStickerfromUrlAsReply(to: ChatId, url: string, messageId: MessageId, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<MessageId | boolean>;
|
1434
1432
|
/**
|
@@ -1505,7 +1503,7 @@ export declare class Client {
|
|
1505
1503
|
* Turn the ephemeral setting in a chat to on or off
|
1506
1504
|
* @param chatId The ID of the chat
|
1507
1505
|
* @param ephemeral `true` to turn on the ephemeral setting, `false` to turn off the ephemeral setting. Please note, if the setting is already on the requested setting, this method will return `true`.
|
1508
|
-
* @returns Promise<boolean
|
1506
|
+
* @returns `Promise<boolean>` true if the setting was set, `false` if the chat does not exist
|
1509
1507
|
*/
|
1510
1508
|
setChatEphemeral(chatId: ChatId, ephemeral: boolean): Promise<boolean>;
|
1511
1509
|
/**
|
@@ -1528,7 +1526,7 @@ export declare class Client {
|
|
1528
1526
|
* 3: [Bryndan Write](https://www.dafontfree.net/freefonts-bryndan-write-f160189.htm)
|
1529
1527
|
* 4: [Bebasneue Regular](https://www.dafont.com/bebas-neue.font)
|
1530
1528
|
* 5: [Oswald Heavy](https://www.fontsquirrel.com/fonts/oswald)
|
1531
|
-
* @returns Promise<string | boolean
|
1529
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
1532
1530
|
*/
|
1533
1531
|
postTextStatus(text: Content, textRgba: string, backgroundRgba: string, font: number): Promise<MessageId | string | boolean>;
|
1534
1532
|
/**
|
@@ -1537,7 +1535,7 @@ export declare class Client {
|
|
1537
1535
|
* Posts an image story.
|
1538
1536
|
* @param data data url string `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
|
1539
1537
|
* @param caption The caption for the story
|
1540
|
-
* @returns Promise<string | boolean
|
1538
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
1541
1539
|
*/
|
1542
1540
|
postImageStatus(data: DataURL, caption: Content): Promise<MessageId | string | boolean>;
|
1543
1541
|
/**
|
@@ -1546,7 +1544,7 @@ export declare class Client {
|
|
1546
1544
|
* Posts a video story.
|
1547
1545
|
* @param data data url string `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
|
1548
1546
|
* @param caption The caption for the story
|
1549
|
-
* @returns Promise<string | boolean
|
1547
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
1550
1548
|
*/
|
1551
1549
|
postVideoStatus(data: DataURL, caption: Content): Promise<MessageId | string | boolean>;
|
1552
1550
|
/**
|
@@ -1632,7 +1630,7 @@ export declare class Client {
|
|
1632
1630
|
*
|
1633
1631
|
* Sets the profile pic of the host number.
|
1634
1632
|
* @param data string data url image string.
|
1635
|
-
* @returns Promise<boolean
|
1633
|
+
* @returns `Promise<boolean>` success if true
|
1636
1634
|
*/
|
1637
1635
|
setProfilePic(data: DataURL): Promise<boolean>;
|
1638
1636
|
/**
|
@@ -1,3 +1,6 @@
|
|
1
|
+
declare type Brand<K, T> = K & {
|
2
|
+
__brand?: T;
|
3
|
+
};
|
1
4
|
/**
|
2
5
|
* The suffix used to identify a non-group chat id
|
3
6
|
*/
|
@@ -33,7 +36,7 @@ export declare type GroupChatId = `${AccountNumber}-${number}@${GroupChatServer}
|
|
33
36
|
*
|
34
37
|
* `"447123456789@c.us"`
|
35
38
|
*/
|
36
|
-
export declare type ContactId =
|
39
|
+
export declare type ContactId = Brand<`${AccountNumber}@${ChatServer}`, "ContactId">;
|
37
40
|
/**
|
38
41
|
* A chat id ends with `@c.us` or `@g.us` for group chats.
|
39
42
|
*
|
@@ -51,7 +54,7 @@ export declare type ChatId = ContactId | GroupChatId;
|
|
51
54
|
*
|
52
55
|
* `"false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"`
|
53
56
|
*/
|
54
|
-
export declare type MessageId =
|
57
|
+
export declare type MessageId = Brand<`${boolean}_${ChatId}_${string}`, "MessageId">;
|
55
58
|
/**
|
56
59
|
* This is a generic type alias for the content of a message
|
57
60
|
*
|
@@ -59,7 +62,7 @@ export declare type MessageId = `${boolean}_${ChatId}_${string}`;
|
|
59
62
|
*
|
60
63
|
* `"hello!"`
|
61
64
|
*/
|
62
|
-
export declare type Content = string
|
65
|
+
export declare type Content = Brand<string, "Content">;
|
63
66
|
export declare type NonSerializedId = {
|
64
67
|
server: WaServers;
|
65
68
|
user: AccountNumber;
|
@@ -77,7 +80,7 @@ export declare type NonSerializedId = {
|
|
77
80
|
*
|
78
81
|
* Learn more here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
79
82
|
*/
|
80
|
-
export declare type DataURL = string;
|
83
|
+
export declare type DataURL = Brand<`data:${string};base64,${Base64}`, "DataURL">;
|
81
84
|
/**
|
82
85
|
* Base64 is basically a file encoded as a string.
|
83
86
|
*
|
@@ -85,10 +88,11 @@ export declare type DataURL = string;
|
|
85
88
|
*
|
86
89
|
* Learn more here: https://developer.mozilla.org/en-US/docs/Glossary/Base64
|
87
90
|
*/
|
88
|
-
export declare type Base64 = string
|
91
|
+
export declare type Base64 = Brand<string, "Base64">;
|
89
92
|
/**
|
90
93
|
* The relative or absolute path of a file
|
91
94
|
*
|
92
95
|
* Learn more here: https://www.w3schools.com/html/html_filepaths.asp
|
93
96
|
*/
|
94
|
-
export declare type FilePath = string
|
97
|
+
export declare type FilePath = Brand<string, "FilePath">;
|
98
|
+
export {};
|
@@ -687,7 +687,7 @@ export interface ConfigObject {
|
|
687
687
|
/**
|
688
688
|
* What to do when an error is detected on a client method.
|
689
689
|
*
|
690
|
-
* @default `NOTHING`
|
690
|
+
* @default `OnError.NOTHING`
|
691
691
|
*/
|
692
692
|
onError?: OnError;
|
693
693
|
/**
|
@@ -697,6 +697,9 @@ export interface ConfigObject {
|
|
697
697
|
* Set this to true if you're using the multidevice beta.
|
698
698
|
*
|
699
699
|
* @default `false`
|
700
|
+
* :::danger
|
701
|
+
* Some features (e.g [[sendLinkWithAutoPreview]]) **do not** work with multi-device beta. Check [this `api`](#).
|
702
|
+
* :::
|
700
703
|
*/
|
701
704
|
multiDevice?: boolean;
|
702
705
|
/**
|
@@ -3,13 +3,13 @@ import { Spin } from './events';
|
|
3
3
|
import { ConfigObject } from '../api/model';
|
4
4
|
import { Page } from 'puppeteer';
|
5
5
|
/**
|
6
|
+
* isAuthenticated
|
6
7
|
* Validates if client is authenticated
|
7
8
|
* @returns true if is authenticated, false otherwise
|
8
9
|
* @param waPage
|
9
10
|
*/
|
10
11
|
export declare const isAuthenticated: (waPage: Page) => Promise<unknown>;
|
11
12
|
export declare const needsToScan: (waPage: Page) => Observable<unknown>;
|
12
|
-
export declare const isInsideChat: (waPage: Page) => Observable<boolean>;
|
13
13
|
export declare const waitForRipeSession: (waPage: Page) => Promise<boolean>;
|
14
14
|
export declare const sessionDataInvalid: (waPage: Page) => Promise<string>;
|
15
15
|
export declare const phoneIsOutOfReach: (waPage: Page) => Promise<boolean>;
|
@@ -27,6 +27,10 @@ export declare class QRManager {
|
|
27
27
|
grabAndEmit(qrData: any, waPage: Page, config: ConfigObject, spinner: Spin): Promise<void>;
|
28
28
|
smartQr(waPage: Page, config?: ConfigObject, spinner?: Spin): Promise<boolean | void | string>;
|
29
29
|
emitFirst(waPage: Page, config?: ConfigObject, spinner?: Spin): Promise<void>;
|
30
|
+
/**
|
31
|
+
* Wait 10 seconds for the qr element to show.
|
32
|
+
* If it doesn't show up within 10 seconds then assume the session is authed already or blocked therefore ignore and return promise
|
33
|
+
*/
|
30
34
|
waitFirstQr(waPage: Page, config?: ConfigObject, spinner?: Spin): Promise<void>;
|
31
35
|
}
|
32
36
|
export declare const qrManager: QRManager;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare class ScriptLoader {
|
2
|
+
scripts: string[];
|
3
|
+
contentRegistry: {
|
4
|
+
[key: string]: string;
|
5
|
+
};
|
6
|
+
constructor();
|
7
|
+
loadScripts(): Promise<{
|
8
|
+
[key: string]: string;
|
9
|
+
}>;
|
10
|
+
getScript(scriptName: string): Promise<string>;
|
11
|
+
flush(): void;
|
12
|
+
getScripts(): {
|
13
|
+
[key: string]: string;
|
14
|
+
};
|
15
|
+
}
|
16
|
+
declare const scriptLoader: ScriptLoader;
|
17
|
+
export { scriptLoader };
|