cloudstorm 0.8.5 → 0.8.7

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/index.d.ts CHANGED
@@ -90,15 +90,15 @@ interface IClientWSOptions {
90
90
  * RatelimitBucket, used for ratelimiting the execution of functions.
91
91
  */
92
92
  declare class RatelimitBucket {
93
+ limit: number;
94
+ limitReset: number;
95
+ defaultReset?: number | undefined;
93
96
  fnQueue: Array<{
94
97
  fn: () => unknown;
95
98
  callback: () => unknown;
96
99
  error: Error;
97
100
  }>;
98
- limit: number;
99
101
  remaining: number;
100
- limitReset: number;
101
- defaultReset: number | undefined;
102
102
  resetTimeout: NodeJS.Timeout | null;
103
103
  /**
104
104
  * Create a new Bucket.
@@ -106,7 +106,7 @@ declare class RatelimitBucket {
106
106
  * @param limitReset Timeframe in milliseconds until the ratelimit resets.
107
107
  * @param defaultReset If the bucket info does not provide default values, but provides remaining, this is the reset to use after the initial reset.
108
108
  */
109
- constructor(limit?: number, limitReset?: number, defaultReset?: number);
109
+ constructor(limit?: number, limitReset?: number, defaultReset?: number | undefined);
110
110
  /**
111
111
  * Queue a function to be executed.
112
112
  * @param fn Function to be executed.
@@ -153,10 +153,10 @@ interface BetterWs {
153
153
  * Helper Class for simplifying the websocket connection to Discord.
154
154
  */
155
155
  declare class BetterWs extends EventEmitter {
156
- encoding: "etf" | "json";
157
- compress: boolean;
158
156
  address: string;
159
157
  options: IClientWSOptions;
158
+ encoding: "etf" | "json";
159
+ compress: boolean;
160
160
  wsBucket: RatelimitBucket;
161
161
  presenceBucket: RatelimitBucket;
162
162
  private _socket;
@@ -202,11 +202,13 @@ interface DiscordConnector {
202
202
  */
203
203
  declare class DiscordConnector extends EventEmitter {
204
204
  id: number;
205
- client: EventEmitter;
206
- options: Omit<IClientOptions, "snowtransferInstance"> & {
207
- token: string;
208
- endpoint?: string;
205
+ client: EventEmitter & {
206
+ options: Omit<IClientOptions, "snowtransferInstance"> & {
207
+ token: string;
208
+ endpoint?: string;
209
+ };
209
210
  };
211
+ options: DiscordConnector["client"]["options"];
210
212
  reconnect: boolean;
211
213
  betterWs: BetterWs;
212
214
  heartbeatTimeout: NodeJS.Timeout | null;
@@ -365,7 +367,12 @@ declare class Shard extends EventEmitter {
365
367
  * @param id id of the shard.
366
368
  * @param client Main class used for forwarding events.
367
369
  */
368
- constructor(id: number, client: Shard["client"]);
370
+ constructor(id: number, client: EventEmitter & {
371
+ options: Omit<IClientOptions, "snowtransferInstance"> & {
372
+ token: string;
373
+ endpoint?: string;
374
+ };
375
+ });
369
376
  /**
370
377
  * Time in ms it took for Discord to ackknowledge an OP 1 HEARTBEAT.
371
378
  */
@@ -416,7 +423,12 @@ declare class ShardManager {
416
423
  /**
417
424
  * Create a new ShardManager.
418
425
  */
419
- constructor(client: ShardManager["client"]);
426
+ constructor(client: events.EventEmitter & {
427
+ options: Omit<IClientOptions, "snowtransferInstance"> & {
428
+ token: string;
429
+ endpoint?: string;
430
+ };
431
+ });
420
432
  /**
421
433
  * Create shard instances and add them to the connection queue.
422
434
  */