@wildix/xbees-conversations-utils 1.1.63 → 1.1.64
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.
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { StreamChat } from 'stream-chat';
|
|
2
2
|
import { StreamType } from '../stream';
|
|
3
|
-
import { LoggerContext,
|
|
3
|
+
import { LoggerContext, MethodWithRateLimitOptions, RedisContext } from './types';
|
|
4
|
+
export type RateLimited<T extends object> = {
|
|
5
|
+
[Key in keyof T]: MethodWithRateLimitOptions<T[Key]>;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* Creates a proxy around a Stream client that transparently applies rate-limit handling
|
|
6
9
|
* to method calls and recursively wraps returned channel objects with the same behavior.
|
|
@@ -14,9 +14,6 @@ export type StreamRateLimitOptionsToken = {
|
|
|
14
14
|
[STREAM_RATE_LIMIT_OPTIONS_MARKER]: Partial<StreamRateLimitRetryOptions>;
|
|
15
15
|
};
|
|
16
16
|
export type MethodWithRateLimitOptions<T> = T extends (...args: infer Args) => infer Result ? T & ((...args: [...Args, StreamRateLimitOptionsToken?]) => Result) : T;
|
|
17
|
-
export type RateLimited<T extends object> = {
|
|
18
|
-
[Key in keyof T]: MethodWithRateLimitOptions<T[Key]>;
|
|
19
|
-
};
|
|
20
17
|
export type RedisContext = {
|
|
21
18
|
redis: Redis;
|
|
22
19
|
};
|