@open-wa/wa-automate-types-only 4.40.0 → 4.41.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.
@@ -114,6 +114,11 @@ export declare class Client {
114
114
  */
115
115
  private registerListener;
116
116
  private registerPageEventListener;
117
+ /**
118
+ * It calls the JavaScript garbage collector
119
+ * @returns Nothing.
120
+ */
121
+ gc(): Promise<void>;
117
122
  /**
118
123
  * Listens to a log out event
119
124
  *
@@ -34,6 +34,16 @@ export declare enum DIRECTORY_STRATEGY {
34
34
  */
35
35
  DATE_CHAT = "DATE_CHAT"
36
36
  }
37
+ declare type SessionId = string;
38
+ declare type LicenseKey = string;
39
+ declare type HostAccountNumber = `${number}`;
40
+ declare type HostAccountNumberOrSessionID = HostAccountNumber | SessionId;
41
+ declare type LicenseKeyConfigObject = {
42
+ [key: HostAccountNumberOrSessionID]: LicenseKey;
43
+ };
44
+ declare type LicenseKeyConfigFunctionReturn = LicenseKeyConfigObject | LicenseKey;
45
+ declare type LicenseKeyConfigFunction = (sessionId?: SessionId, number?: HostAccountNumber) => LicenseKeyConfigFunctionReturn | Promise<LicenseKeyConfigFunctionReturn>;
46
+ declare type LicenseKeyConfig = LicenseKeyConfigFunction | LicenseKeyConfigObject | LicenseKey;
37
47
  /**
38
48
  * The available languages for the host security notification
39
49
  */
@@ -265,7 +275,7 @@ export interface ConfigObject {
265
275
  * 1. You can change the number assigned to that License Key at any time, just message me the new number on the private discord channel.
266
276
  * 2. In order to cancel your License Key, simply stop your membership.
267
277
  */
268
- licenseKey?: string | string[];
278
+ licenseKey?: LicenseKey;
269
279
  /**
270
280
  * You may set a custom user agent. However, due to recent developments, this is not really neccessary any more.
271
281
  */
@@ -768,6 +778,16 @@ export interface ConfigObject {
768
778
  * default: `https://link.openwa.cloud/api`
769
779
  */
770
780
  linkParser?: string;
781
+ /**
782
+ * Setting this to true will run `gc()` on before every command sent to the browser.
783
+ *
784
+ * This is experimental and may not work or it may have unforeseen sideeffects.
785
+ */
786
+ aggressiveGarbageCollection?: boolean;
771
787
  /**@internal */
772
788
  [x: string]: any;
773
789
  }
790
+ export declare type AdvancedConfig = ConfigObject & {
791
+ licenseKey: LicenseKeyConfig;
792
+ };
793
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Client } from '../api/Client';
2
- import { ConfigObject } from '../api/model/index';
2
+ import { AdvancedConfig, ConfigObject } from '../api/model/index';
3
3
  export declare const pkg: any, configWithCases: any, timeout: (ms: number) => Promise<unknown>;
4
4
  export declare let screenshot: any;
5
5
  /**
@@ -17,6 +17,6 @@ export declare let screenshot: any;
17
17
  * ...
18
18
  * })....
19
19
  * ```
20
- * @param config ConfigObject] The extended custom configuration
20
+ * @param config AdvancedConfig The extended custom configuration
21
21
  */
22
- export declare function create(config?: ConfigObject): Promise<Client>;
22
+ export declare function create(config?: AdvancedConfig | ConfigObject): Promise<Client>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate-types-only",
3
- "version": "4.40.0",
3
+ "version": "4.41.0",
4
4
  "description": "Types generated from the @open-wa/wa-automate package",
5
5
  "scripts": {
6
6
  "build": "tsc",