cloudstorm 0.8.4 → 0.8.6
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 +25 -12
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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;
|
|
@@ -256,6 +258,7 @@ declare class DiscordConnector extends EventEmitter {
|
|
|
256
258
|
* Hard reset this connector.
|
|
257
259
|
*/
|
|
258
260
|
private reset;
|
|
261
|
+
private setHeartBeat;
|
|
259
262
|
/**
|
|
260
263
|
* Clear the heart beat interval, set it to null and set the cached heartbeat_interval as 0.
|
|
261
264
|
*/
|
|
@@ -364,7 +367,12 @@ declare class Shard extends EventEmitter {
|
|
|
364
367
|
* @param id id of the shard.
|
|
365
368
|
* @param client Main class used for forwarding events.
|
|
366
369
|
*/
|
|
367
|
-
constructor(id: number, client:
|
|
370
|
+
constructor(id: number, client: EventEmitter & {
|
|
371
|
+
options: Omit<IClientOptions, "snowtransferInstance"> & {
|
|
372
|
+
token: string;
|
|
373
|
+
endpoint?: string;
|
|
374
|
+
};
|
|
375
|
+
});
|
|
368
376
|
/**
|
|
369
377
|
* Time in ms it took for Discord to ackknowledge an OP 1 HEARTBEAT.
|
|
370
378
|
*/
|
|
@@ -415,7 +423,12 @@ declare class ShardManager {
|
|
|
415
423
|
/**
|
|
416
424
|
* Create a new ShardManager.
|
|
417
425
|
*/
|
|
418
|
-
constructor(client:
|
|
426
|
+
constructor(client: events.EventEmitter & {
|
|
427
|
+
options: Omit<IClientOptions, "snowtransferInstance"> & {
|
|
428
|
+
token: string;
|
|
429
|
+
endpoint?: string;
|
|
430
|
+
};
|
|
431
|
+
});
|
|
419
432
|
/**
|
|
420
433
|
* Create shard instances and add them to the connection queue.
|
|
421
434
|
*/
|