@wppconnect/wa-js 1.2.5 → 2.0.0
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/CHANGELOG.md +9 -0
- package/dist/blocklist/events/eventTypes.d.ts +18 -0
- package/dist/blocklist/index.d.ts +0 -1
- package/dist/chat/{eventEmitter.d.ts → events/eventTypes.d.ts} +36 -38
- package/dist/chat/events/index.d.ts +3 -1
- package/dist/{patch.d.ts → chat/events/registerNewMessageEvent.d.ts} +0 -0
- package/dist/chat/events/registerPresenceChange.d.ts +16 -0
- package/dist/chat/index.d.ts +0 -1
- package/dist/conn/events/eventTypes.d.ts +55 -0
- package/dist/conn/functions/index.d.ts +1 -0
- package/dist/conn/functions/setKeepAlive.d.ts +28 -0
- package/dist/conn/index.d.ts +0 -1
- package/dist/contact/functions/getProfilePictureUrl.d.ts +27 -0
- package/dist/contact/functions/index.d.ts +1 -0
- package/dist/contact/index.d.ts +0 -1
- package/dist/eventEmitter/eventEmitter.d.ts +169 -0
- package/dist/eventEmitter/eventTypes.d.ts +26 -0
- package/dist/eventEmitter/index.d.ts +195 -0
- package/dist/group/index.d.ts +0 -1
- package/dist/index.d.ts +3 -1
- package/dist/labels/index.d.ts +0 -1
- package/dist/profile/index.d.ts +0 -1
- package/dist/status/events/eventTypes.d.ts +18 -0
- package/dist/status/index.d.ts +0 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/types.d.ts +2 -0
- package/dist/util/wrapFunction.d.ts +20 -0
- package/dist/webpack/eventTypes.d.ts +19 -0
- package/dist/{webpack.d.ts → webpack/index.d.ts} +0 -0
- package/dist/whatsapp/collections/CallCollection.d.ts +3 -1
- package/dist/whatsapp/collections/ParticipantCollection.d.ts +3 -1
- package/dist/whatsapp/collections/PresenceCollection.d.ts +4 -4
- package/dist/whatsapp/collections/ProfilePicThumbCollection.d.ts +2 -4
- package/dist/whatsapp/collections/RecentStickerCollection.d.ts +3 -1
- package/dist/whatsapp/collections/StickerPackCollection.d.ts +3 -1
- package/dist/whatsapp/enums/ACK.d.ts +9 -3
- package/dist/whatsapp/enums/GROUP_SETTING_TYPE.d.ts +3 -1
- package/dist/whatsapp/enums/MSG_TYPE.d.ts +6 -2
- package/dist/whatsapp/exportModule.d.ts +19 -1
- package/dist/whatsapp/functions/createMsgProtobuf.d.ts +3 -1
- package/dist/whatsapp/functions/fetchLinkPreview.d.ts +3 -1
- package/dist/whatsapp/functions/findFirstWebLink.d.ts +3 -1
- package/dist/whatsapp/functions/getOrGenerate.d.ts +3 -1
- package/dist/whatsapp/functions/handleAck.d.ts +17 -3
- package/dist/whatsapp/functions/index.d.ts +3 -0
- package/dist/whatsapp/functions/isAuthenticated.d.ts +6 -3
- package/dist/whatsapp/functions/isMDBackend.d.ts +19 -0
- package/dist/whatsapp/functions/mediaTypeFromProtobuf.d.ts +19 -0
- package/dist/whatsapp/functions/profilePic.d.ts +2 -1
- package/dist/whatsapp/functions/randomId.d.ts +3 -1
- package/dist/whatsapp/functions/sendQueryExists.d.ts +3 -1
- package/dist/whatsapp/functions/status.d.ts +6 -2
- package/dist/whatsapp/functions/typeAttributeFromProtobuf.d.ts +19 -0
- package/dist/whatsapp/misc/Browser.d.ts +3 -1
- package/dist/whatsapp/misc/Clock.d.ts +6 -2
- package/dist/whatsapp/misc/Constants.d.ts +3 -1
- package/dist/whatsapp/misc/EventEmitter.d.ts +3 -1
- package/dist/whatsapp/misc/ImageUtils.d.ts +3 -1
- package/dist/whatsapp/misc/Locale.d.ts +3 -1
- package/dist/whatsapp/misc/MsgKey.d.ts +3 -1
- package/dist/whatsapp/misc/UserPrefs.d.ts +3 -1
- package/dist/whatsapp/misc/VCard.d.ts +3 -1
- package/dist/whatsapp/misc/Wap.d.ts +6 -2
- package/dist/whatsapp/misc/Wid.d.ts +3 -1
- package/dist/whatsapp/misc/WidFactory.d.ts +3 -1
- package/dist/whatsapp/models/CallModel.d.ts +6 -2
- package/dist/whatsapp/models/CallParticipantModel.d.ts +6 -2
- package/dist/whatsapp/models/PresenceModel.d.ts +49 -0
- package/dist/whatsapp/models/ProfilePicThumbModel.d.ts +3 -3
- package/dist/whatsapp/models/StickerModel.d.ts +6 -2
- package/dist/whatsapp/models/WebCallModel.d.ts +6 -2
- package/dist/whatsapp/models/index.d.ts +1 -0
- package/dist/whatsapp/multidevice/adv.d.ts +3 -1
- package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +3 -1
- package/dist/whatsapp/stores.d.ts +3 -1
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +8 -0
- package/package.json +26 -23
- package/dist/blocklist/eventEmitter.d.ts +0 -49
- package/dist/conn/eventEmitter.d.ts +0 -86
- package/dist/contact/eventEmitter.d.ts +0 -48
- package/dist/group/eventEmitter.d.ts +0 -48
- package/dist/labels/eventEmitter.d.ts +0 -48
- package/dist/profile/eventEmitter.d.ts +0 -48
- package/dist/status/eventEmitter.d.ts +0 -49
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/*!
|
|
18
|
+
* EventEmitter2
|
|
19
|
+
* https://github.com/hij1nx/EventEmitter2
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2013 hij1nx
|
|
22
|
+
* Licensed under the MIT license.
|
|
23
|
+
*/
|
|
24
|
+
|
|
17
25
|
/*!
|
|
18
26
|
* The buffer module from node.js, for the browser.
|
|
19
27
|
*
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect/wa-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web",
|
|
5
|
-
"
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./dist/wppconnect-wa.js"
|
|
8
|
-
},
|
|
5
|
+
"license": "Apache-2.0",
|
|
9
6
|
"author": {
|
|
10
7
|
"name": "Edgard Messias",
|
|
11
8
|
"email": "edgardmessias@gmail.com",
|
|
12
9
|
"url": "https://github.com/edgardmessias"
|
|
13
10
|
},
|
|
14
|
-
"
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/wppconnect-wa.js"
|
|
13
|
+
},
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build:dev": "webpack --devtool inline-source-map --mode development",
|
|
17
17
|
"build:prd": "webpack",
|
|
@@ -30,53 +30,56 @@
|
|
|
30
30
|
"release": "release-it",
|
|
31
31
|
"test": "playwright test --project tests",
|
|
32
32
|
"test:prepare": "playwright test --project prepare --headed",
|
|
33
|
-
"update-module-id": "ts-node ./src/tools/updateModuleID.ts",
|
|
34
33
|
"update-models-attributes": "ts-node ./src/tools/updateModelsAttributes.ts",
|
|
34
|
+
"update-module-id": "ts-node ./src/tools/updateModuleID.ts",
|
|
35
|
+
"wa-source": "npm run wa-source:clean && npm run wa-source:download",
|
|
35
36
|
"wa-source:clean": "shx rm -rf wa-source",
|
|
36
37
|
"wa-source:download": "ts-node ./src/tools/extractWhatsappSource.ts",
|
|
37
38
|
"wa-source:format": "prettier --write ./wa-source",
|
|
38
|
-
"wa-source": "npm run wa-source:clean && npm run wa-source:download",
|
|
39
39
|
"watch": "webpack watch --devtool inline-source-map --mode development"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@commitlint/cli": "^16.2.3",
|
|
43
43
|
"@commitlint/config-conventional": "^16.2.1",
|
|
44
44
|
"@commitlint/prompt-cli": "^16.2.3",
|
|
45
|
-
"@playwright/test": "^1.
|
|
45
|
+
"@playwright/test": "^1.21.1",
|
|
46
46
|
"@types/debug": "^4.1.7",
|
|
47
|
-
"@types/node": "^14.18.
|
|
47
|
+
"@types/node": "^14.18.13",
|
|
48
48
|
"@types/parse-data-url": "^3.0.0",
|
|
49
|
-
"@types/prettier": "^2.
|
|
49
|
+
"@types/prettier": "^2.6.0",
|
|
50
50
|
"@types/shelljs": "^0.8.11",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
52
|
-
"@typescript-eslint/parser": "^5.
|
|
53
|
-
"@wppconnect/wa-version": "^1.1.
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
52
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
53
|
+
"@wppconnect/wa-version": "^1.1.64",
|
|
54
54
|
"buffer": "^6.0.3",
|
|
55
55
|
"conventional-changelog-cli": "^2.2.2",
|
|
56
56
|
"debug": "^4.3.4",
|
|
57
|
-
"
|
|
58
|
-
"eslint": "^8.11.0",
|
|
57
|
+
"eslint": "^8.13.0",
|
|
59
58
|
"eslint-config-prettier": "^8.5.0",
|
|
60
59
|
"eslint-plugin-header": "^3.1.1",
|
|
61
|
-
"eslint-plugin-import": "^2.
|
|
60
|
+
"eslint-plugin-import": "^2.26.0",
|
|
62
61
|
"eslint-plugin-prettier": "^4.0.0",
|
|
63
62
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
63
|
+
"eventemitter2": "^6.4.5",
|
|
64
64
|
"file-type": "~16.5.3",
|
|
65
65
|
"husky": "^7.0.4",
|
|
66
66
|
"parse-data-url": "^4.0.1",
|
|
67
|
-
"playwright-chromium": "^1.
|
|
68
|
-
"prettier": "^2.6.
|
|
67
|
+
"playwright-chromium": "^1.21.1",
|
|
68
|
+
"prettier": "^2.6.2",
|
|
69
69
|
"pretty-quick": "^3.1.3",
|
|
70
|
-
"release-it": "^14.
|
|
70
|
+
"release-it": "^14.14.2",
|
|
71
71
|
"shx": "^0.3.4",
|
|
72
72
|
"ts-loader": "^9.2.8",
|
|
73
73
|
"ts-morph": "^14.0.0",
|
|
74
74
|
"ts-node": "^10.7.0",
|
|
75
75
|
"typedoc": "^0.22.12",
|
|
76
|
-
"typedoc-plugin-mdn-links": "^1.0.
|
|
76
|
+
"typedoc-plugin-mdn-links": "^1.0.6",
|
|
77
77
|
"typedoc-plugin-missing-exports": "^0.22.6",
|
|
78
|
-
"typescript": "^4.6.
|
|
79
|
-
"webpack": "^5.
|
|
78
|
+
"typescript": "^4.6.3",
|
|
79
|
+
"webpack": "^5.72.0",
|
|
80
80
|
"webpack-cli": "^4.9.2"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"whatsapp-web": ">=2.2210.6-beta"
|
|
81
84
|
}
|
|
82
85
|
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
sync: undefined;
|
|
20
|
-
}
|
|
21
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, "sync">;
|
|
22
|
-
/**
|
|
23
|
-
* Subscribe to one event.
|
|
24
|
-
* @event
|
|
25
|
-
* @returns An unsubscribe method.
|
|
26
|
-
*/
|
|
27
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
28
|
-
/**
|
|
29
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
30
|
-
* @event
|
|
31
|
-
*/
|
|
32
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
33
|
-
/**
|
|
34
|
-
* @event
|
|
35
|
-
*/
|
|
36
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
37
|
-
/**
|
|
38
|
-
* Clear all event listeners on the instance.
|
|
39
|
-
*
|
|
40
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
41
|
-
*
|
|
42
|
-
* @event
|
|
43
|
-
*/
|
|
44
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
47
|
-
* @event
|
|
48
|
-
*/
|
|
49
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
import { AuthCode } from '.';
|
|
18
|
-
export declare type UnsubscribeFn = () => void;
|
|
19
|
-
export interface EventTypes {
|
|
20
|
-
auth_code_change: AuthCode | null;
|
|
21
|
-
/**
|
|
22
|
-
* Triggered afted a success QR code scan
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```javascript
|
|
26
|
-
* WPP.conn.on('authenticated', () => {
|
|
27
|
-
* // Your code
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
authenticated: undefined;
|
|
32
|
-
logout: undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Triggered when the main interface is loaded, but is syncing
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```javascript
|
|
38
|
-
* WPP.conn.on('main_loaded', () => {
|
|
39
|
-
* // Your code
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
main_loaded: undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Triggered when the main interface is loaded, authenticated and ready to send message
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```javascript
|
|
49
|
-
* WPP.conn.on('main_ready', () => {
|
|
50
|
-
* // Your code
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
main_ready: undefined;
|
|
55
|
-
qrcode_idle: undefined;
|
|
56
|
-
require_auth: undefined;
|
|
57
|
-
}
|
|
58
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, "authenticated" | "logout" | "main_loaded" | "main_ready" | "qrcode_idle" | "require_auth">;
|
|
59
|
-
/**
|
|
60
|
-
* Subscribe to one event.
|
|
61
|
-
* @event
|
|
62
|
-
* @returns An unsubscribe method.
|
|
63
|
-
*/
|
|
64
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
65
|
-
/**
|
|
66
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
67
|
-
* @event
|
|
68
|
-
*/
|
|
69
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
70
|
-
/**
|
|
71
|
-
* @event
|
|
72
|
-
*/
|
|
73
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
74
|
-
/**
|
|
75
|
-
* Clear all event listeners on the instance.
|
|
76
|
-
*
|
|
77
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
78
|
-
*
|
|
79
|
-
* @event
|
|
80
|
-
*/
|
|
81
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
82
|
-
/**
|
|
83
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
84
|
-
* @event
|
|
85
|
-
*/
|
|
86
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
}
|
|
20
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe to one event.
|
|
23
|
-
* @event
|
|
24
|
-
* @returns An unsubscribe method.
|
|
25
|
-
*/
|
|
26
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
27
|
-
/**
|
|
28
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
29
|
-
* @event
|
|
30
|
-
*/
|
|
31
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
32
|
-
/**
|
|
33
|
-
* @event
|
|
34
|
-
*/
|
|
35
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Clear all event listeners on the instance.
|
|
38
|
-
*
|
|
39
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
40
|
-
*
|
|
41
|
-
* @event
|
|
42
|
-
*/
|
|
43
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
44
|
-
/**
|
|
45
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
46
|
-
* @event
|
|
47
|
-
*/
|
|
48
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
}
|
|
20
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe to one event.
|
|
23
|
-
* @event
|
|
24
|
-
* @returns An unsubscribe method.
|
|
25
|
-
*/
|
|
26
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
27
|
-
/**
|
|
28
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
29
|
-
* @event
|
|
30
|
-
*/
|
|
31
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
32
|
-
/**
|
|
33
|
-
* @event
|
|
34
|
-
*/
|
|
35
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Clear all event listeners on the instance.
|
|
38
|
-
*
|
|
39
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
40
|
-
*
|
|
41
|
-
* @event
|
|
42
|
-
*/
|
|
43
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
44
|
-
/**
|
|
45
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
46
|
-
* @event
|
|
47
|
-
*/
|
|
48
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
}
|
|
20
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe to one event.
|
|
23
|
-
* @event
|
|
24
|
-
* @returns An unsubscribe method.
|
|
25
|
-
*/
|
|
26
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
27
|
-
/**
|
|
28
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
29
|
-
* @event
|
|
30
|
-
*/
|
|
31
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
32
|
-
/**
|
|
33
|
-
* @event
|
|
34
|
-
*/
|
|
35
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Clear all event listeners on the instance.
|
|
38
|
-
*
|
|
39
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
40
|
-
*
|
|
41
|
-
* @event
|
|
42
|
-
*/
|
|
43
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
44
|
-
/**
|
|
45
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
46
|
-
* @event
|
|
47
|
-
*/
|
|
48
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
}
|
|
20
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe to one event.
|
|
23
|
-
* @event
|
|
24
|
-
* @returns An unsubscribe method.
|
|
25
|
-
*/
|
|
26
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
27
|
-
/**
|
|
28
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
29
|
-
* @event
|
|
30
|
-
*/
|
|
31
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
32
|
-
/**
|
|
33
|
-
* @event
|
|
34
|
-
*/
|
|
35
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Clear all event listeners on the instance.
|
|
38
|
-
*
|
|
39
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
40
|
-
*
|
|
41
|
-
* @event
|
|
42
|
-
*/
|
|
43
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
44
|
-
/**
|
|
45
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
46
|
-
* @event
|
|
47
|
-
*/
|
|
48
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 WPPConnect Team
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import Emittery from 'emittery';
|
|
17
|
-
export declare type UnsubscribeFn = () => void;
|
|
18
|
-
export interface EventTypes {
|
|
19
|
-
sync: undefined;
|
|
20
|
-
}
|
|
21
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, "sync">;
|
|
22
|
-
/**
|
|
23
|
-
* Subscribe to one event.
|
|
24
|
-
* @event
|
|
25
|
-
* @returns An unsubscribe method.
|
|
26
|
-
*/
|
|
27
|
-
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
28
|
-
/**
|
|
29
|
-
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
30
|
-
* @event
|
|
31
|
-
*/
|
|
32
|
-
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
33
|
-
/**
|
|
34
|
-
* @event
|
|
35
|
-
*/
|
|
36
|
-
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
37
|
-
/**
|
|
38
|
-
* Clear all event listeners on the instance.
|
|
39
|
-
*
|
|
40
|
-
* If `eventName` is given, only the listeners for that event are cleared.
|
|
41
|
-
*
|
|
42
|
-
* @event
|
|
43
|
-
*/
|
|
44
|
-
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* The number of listeners for the `eventName` or all events if not specified.
|
|
47
|
-
* @event
|
|
48
|
-
*/
|
|
49
|
-
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|