@tanstack/pacer 0.21.1 → 0.23.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.
Files changed (101) hide show
  1. package/README.md +21 -6
  2. package/dist/async-batcher.d.ts +11 -14
  3. package/dist/async-batcher.js +186 -132
  4. package/dist/async-debouncer.d.ts +10 -13
  5. package/dist/async-debouncer.js +187 -146
  6. package/dist/async-queuer.d.ts +12 -14
  7. package/dist/async-queuer.js +384 -259
  8. package/dist/async-rate-limiter.d.ts +9 -12
  9. package/dist/async-rate-limiter.js +198 -147
  10. package/dist/async-retryer.d.ts +10 -10
  11. package/dist/async-retryer.js +209 -188
  12. package/dist/async-throttler.d.ts +10 -13
  13. package/dist/async-throttler.js +215 -161
  14. package/dist/batcher.d.ts +5 -8
  15. package/dist/batcher.js +107 -87
  16. package/dist/debouncer.d.ts +6 -9
  17. package/dist/debouncer.js +99 -86
  18. package/dist/event-client.d.ts +8 -11
  19. package/dist/event-client.js +1 -2
  20. package/dist/index.js +1 -1
  21. package/dist/queuer.d.ts +8 -10
  22. package/dist/queuer.js +277 -207
  23. package/dist/rate-limiter.d.ts +6 -9
  24. package/dist/rate-limiter.js +127 -109
  25. package/dist/throttler.d.ts +6 -9
  26. package/dist/throttler.js +127 -90
  27. package/dist/types.d.ts +4 -6
  28. package/dist/utils.d.ts +3 -6
  29. package/dist/utils.js +1 -2
  30. package/package.json +23 -70
  31. package/dist/async-batcher.cjs +0 -337
  32. package/dist/async-batcher.cjs.map +0 -1
  33. package/dist/async-batcher.d.cts +0 -344
  34. package/dist/async-batcher.js.map +0 -1
  35. package/dist/async-debouncer.cjs +0 -330
  36. package/dist/async-debouncer.cjs.map +0 -1
  37. package/dist/async-debouncer.d.cts +0 -300
  38. package/dist/async-debouncer.js.map +0 -1
  39. package/dist/async-queuer.cjs +0 -484
  40. package/dist/async-queuer.cjs.map +0 -1
  41. package/dist/async-queuer.d.cts +0 -440
  42. package/dist/async-queuer.js.map +0 -1
  43. package/dist/async-rate-limiter.cjs +0 -373
  44. package/dist/async-rate-limiter.cjs.map +0 -1
  45. package/dist/async-rate-limiter.d.cts +0 -357
  46. package/dist/async-rate-limiter.js.map +0 -1
  47. package/dist/async-retryer.cjs +0 -374
  48. package/dist/async-retryer.cjs.map +0 -1
  49. package/dist/async-retryer.d.cts +0 -319
  50. package/dist/async-retryer.js.map +0 -1
  51. package/dist/async-throttler.cjs +0 -347
  52. package/dist/async-throttler.cjs.map +0 -1
  53. package/dist/async-throttler.d.cts +0 -320
  54. package/dist/async-throttler.js.map +0 -1
  55. package/dist/batcher.cjs +0 -200
  56. package/dist/batcher.cjs.map +0 -1
  57. package/dist/batcher.d.cts +0 -180
  58. package/dist/batcher.js.map +0 -1
  59. package/dist/debouncer.cjs +0 -203
  60. package/dist/debouncer.cjs.map +0 -1
  61. package/dist/debouncer.d.cts +0 -167
  62. package/dist/debouncer.js.map +0 -1
  63. package/dist/event-client.cjs +0 -64
  64. package/dist/event-client.cjs.map +0 -1
  65. package/dist/event-client.d.cts +0 -66
  66. package/dist/event-client.js.map +0 -1
  67. package/dist/index.cjs +0 -52
  68. package/dist/index.d.cts +0 -15
  69. package/dist/queuer.cjs +0 -401
  70. package/dist/queuer.cjs.map +0 -1
  71. package/dist/queuer.d.cts +0 -345
  72. package/dist/queuer.js.map +0 -1
  73. package/dist/rate-limiter.cjs +0 -263
  74. package/dist/rate-limiter.cjs.map +0 -1
  75. package/dist/rate-limiter.d.cts +0 -215
  76. package/dist/rate-limiter.js.map +0 -1
  77. package/dist/throttler.cjs +0 -215
  78. package/dist/throttler.cjs.map +0 -1
  79. package/dist/throttler.d.cts +0 -207
  80. package/dist/throttler.js.map +0 -1
  81. package/dist/types.cjs +0 -0
  82. package/dist/types.d.cts +0 -13
  83. package/dist/utils.cjs +0 -14
  84. package/dist/utils.cjs.map +0 -1
  85. package/dist/utils.d.cts +0 -8
  86. package/dist/utils.js.map +0 -1
  87. package/src/async-batcher.ts +0 -594
  88. package/src/async-debouncer.ts +0 -565
  89. package/src/async-queuer.ts +0 -925
  90. package/src/async-rate-limiter.ts +0 -647
  91. package/src/async-retryer.ts +0 -684
  92. package/src/async-throttler.ts +0 -633
  93. package/src/batcher.ts +0 -329
  94. package/src/debouncer.ts +0 -334
  95. package/src/event-client.ts +0 -129
  96. package/src/index.ts +0 -24
  97. package/src/queuer.ts +0 -740
  98. package/src/rate-limiter.ts +0 -429
  99. package/src/throttler.ts +0 -380
  100. package/src/types.ts +0 -12
  101. package/src/utils.ts +0 -12
@@ -1,6 +1,6 @@
1
1
  import { parseFunctionOrValue } from "./utils.js";
2
- import { emitChange, pacerEventClient } from "./event-client.js";
3
2
  import { AsyncRetryer } from "./async-retryer.js";
3
+ import { emitChange, pacerEventClient } from "./event-client.js";
4
4
  import { Store } from "@tanstack/store";
5
5
 
6
6
  //#region src/async-debouncer.ts
@@ -86,144 +86,15 @@ const defaultOptions = {
86
86
  * ```
87
87
  */
88
88
  var AsyncDebouncer = class {
89
- #timeoutId;
90
- #resolvePreviousPromise;
89
+ fn;
90
+ store = new Store(getDefaultAsyncDebouncerState());
91
+ key;
92
+ options;
93
+ asyncRetryers = /* @__PURE__ */ new Map();
94
+ #timeoutId = null;
95
+ #resolvePreviousPromise = null;
91
96
  constructor(fn, initialOptions) {
92
97
  this.fn = fn;
93
- this.store = new Store(getDefaultAsyncDebouncerState());
94
- this.asyncRetryers = /* @__PURE__ */ new Map();
95
- this.#timeoutId = null;
96
- this.#resolvePreviousPromise = null;
97
- this.setOptions = (newOptions) => {
98
- this.options = {
99
- ...this.options,
100
- ...newOptions
101
- };
102
- if (!this.#getEnabled()) this.cancel();
103
- };
104
- this.#setState = (newState) => {
105
- this.store.setState((state) => {
106
- const combinedState = {
107
- ...state,
108
- ...newState
109
- };
110
- const { isPending, isExecuting, settleCount } = combinedState;
111
- return {
112
- ...combinedState,
113
- status: !this.#getEnabled() ? "disabled" : isPending ? "pending" : isExecuting ? "executing" : settleCount > 0 ? "settled" : "idle"
114
- };
115
- });
116
- emitChange("AsyncDebouncer", this);
117
- };
118
- this.#getEnabled = () => {
119
- return !!parseFunctionOrValue(this.options.enabled, this);
120
- };
121
- this.#getWait = () => {
122
- return parseFunctionOrValue(this.options.wait, this);
123
- };
124
- this.maybeExecute = async (...args) => {
125
- if (!this.#getEnabled()) return void 0;
126
- this.#cancelPendingExecution();
127
- this.#setState({
128
- lastArgs: args,
129
- maybeExecuteCount: this.store.state.maybeExecuteCount + 1
130
- });
131
- if (this.options.leading && this.store.state.canLeadingExecute) {
132
- this.#setState({ canLeadingExecute: false });
133
- await this.#execute(...args);
134
- return this.store.state.lastResult;
135
- }
136
- if (this.options.trailing && this.#getEnabled()) this.#setState({ isPending: true });
137
- return new Promise((resolve, reject) => {
138
- this.#resolvePreviousPromise = resolve;
139
- this.#timeoutId = setTimeout(async () => {
140
- if (this.options.trailing && this.store.state.lastArgs) try {
141
- await this.#execute(...this.store.state.lastArgs);
142
- } catch (error) {
143
- reject(error);
144
- }
145
- this.#setState({ canLeadingExecute: true });
146
- this.#resolvePreviousPromise = null;
147
- resolve(this.store.state.lastResult);
148
- }, this.#getWait());
149
- });
150
- };
151
- this.#execute = async (...args) => {
152
- if (!this.#getEnabled()) return void 0;
153
- const currentMaybeExecuteCount = this.store.state.maybeExecuteCount + 1;
154
- try {
155
- this.#setState({ isExecuting: true });
156
- const currentAsyncRetryer = new AsyncRetryer(this.fn, {
157
- ...this.options.asyncRetryerOptions,
158
- key: `${this.key}-retryer-${currentMaybeExecuteCount}`
159
- });
160
- this.asyncRetryers.set(currentMaybeExecuteCount, currentAsyncRetryer);
161
- const result = await currentAsyncRetryer.execute(...args);
162
- this.#setState({
163
- lastResult: result,
164
- successCount: this.store.state.successCount + 1
165
- });
166
- this.options.onSuccess?.(result, args, this);
167
- } catch (error) {
168
- this.#setState({ errorCount: this.store.state.errorCount + 1 });
169
- this.options.onError?.(error, args, this);
170
- if (this.options.throwOnError) throw error;
171
- } finally {
172
- this.asyncRetryers.delete(currentMaybeExecuteCount);
173
- this.#setState({
174
- isExecuting: false,
175
- isPending: false,
176
- lastArgs: void 0,
177
- settleCount: this.store.state.settleCount + 1
178
- });
179
- this.options.onSettled?.(args, this);
180
- }
181
- return this.store.state.lastResult;
182
- };
183
- this.flush = async () => {
184
- if (this.store.state.isPending && this.store.state.lastArgs) {
185
- const { lastArgs } = this.store.state;
186
- this.#cancelPendingExecution();
187
- return await this.#execute(...lastArgs);
188
- }
189
- };
190
- this.#resolvePreviousPromiseInternal = () => {
191
- if (this.#resolvePreviousPromise) {
192
- this.#resolvePreviousPromise(this.store.state.lastResult);
193
- this.#resolvePreviousPromise = null;
194
- }
195
- };
196
- this.#clearTimeout = () => {
197
- if (this.#timeoutId) {
198
- clearTimeout(this.#timeoutId);
199
- this.#timeoutId = null;
200
- }
201
- };
202
- this.#cancelPendingExecution = () => {
203
- this.#clearTimeout();
204
- this.#resolvePreviousPromiseInternal();
205
- this.#setState({
206
- isPending: false,
207
- lastArgs: void 0
208
- });
209
- };
210
- this.getAbortSignal = (maybeExecuteCount) => {
211
- const count = maybeExecuteCount ?? this.store.state.maybeExecuteCount;
212
- return this.asyncRetryers.get(count)?.getAbortSignal() ?? null;
213
- };
214
- this.abort = () => {
215
- this.asyncRetryers.forEach((retryer) => retryer.abort());
216
- this.asyncRetryers.clear();
217
- this.#setState({ isExecuting: false });
218
- };
219
- this.cancel = () => {
220
- this.#cancelPendingExecution();
221
- this.#setState({ canLeadingExecute: true });
222
- };
223
- this.reset = () => {
224
- this.#setState(getDefaultAsyncDebouncerState());
225
- this.asyncRetryers.forEach((retryer) => retryer.reset());
226
- };
227
98
  this.key = initialOptions.key;
228
99
  this.options = {
229
100
  ...defaultOptions,
@@ -237,22 +108,193 @@ var AsyncDebouncer = class {
237
108
  this.setOptions(event.payload.options);
238
109
  });
239
110
  }
240
- #setState;
111
+ /**
112
+ * Updates the async debouncer options
113
+ */
114
+ setOptions = (newOptions) => {
115
+ this.options = {
116
+ ...this.options,
117
+ ...newOptions
118
+ };
119
+ if (!this.#getEnabled()) this.cancel();
120
+ };
121
+ #setState = (newState) => {
122
+ this.store.setState((state) => {
123
+ const combinedState = {
124
+ ...state,
125
+ ...newState
126
+ };
127
+ const { isPending, isExecuting, settleCount } = combinedState;
128
+ return {
129
+ ...combinedState,
130
+ status: !this.#getEnabled() ? "disabled" : isPending ? "pending" : isExecuting ? "executing" : settleCount > 0 ? "settled" : "idle"
131
+ };
132
+ });
133
+ emitChange("AsyncDebouncer", this);
134
+ };
241
135
  /**
242
136
  * Returns the current debouncer enabled state
243
137
  */
244
- #getEnabled;
138
+ #getEnabled = () => {
139
+ return !!parseFunctionOrValue(this.options.enabled, this);
140
+ };
245
141
  /**
246
142
  * Returns the current debouncer wait state
247
143
  */
248
- #getWait;
249
- #execute;
250
- #resolvePreviousPromiseInternal;
251
- #clearTimeout;
144
+ #getWait = () => {
145
+ return parseFunctionOrValue(this.options.wait, this);
146
+ };
147
+ /**
148
+ * Attempts to execute the debounced function.
149
+ * If a call is already in progress, it will be queued.
150
+ *
151
+ * Error Handling:
152
+ * - If the debounced function throws and no `onError` handler is configured,
153
+ * the error will be thrown from this method.
154
+ * - If an `onError` handler is configured, errors will be caught and passed to the handler,
155
+ * and this method will return undefined.
156
+ * - The error state can be checked using `getErrorCount()` and `getIsExecuting()`.
157
+ *
158
+ * @returns A promise that resolves with the function's return value, or undefined if an error occurred and was handled by onError
159
+ * @throws The error from the debounced function if no onError handler is configured
160
+ */
161
+ maybeExecute = async (...args) => {
162
+ if (!this.#getEnabled()) return void 0;
163
+ this.#cancelPendingExecution();
164
+ this.#setState({
165
+ lastArgs: args,
166
+ maybeExecuteCount: this.store.state.maybeExecuteCount + 1
167
+ });
168
+ if (this.options.leading && this.store.state.canLeadingExecute) {
169
+ this.#setState({ canLeadingExecute: false });
170
+ await this.#execute(...args);
171
+ return this.store.state.lastResult;
172
+ }
173
+ if (this.options.trailing && this.#getEnabled()) this.#setState({ isPending: true });
174
+ return new Promise((resolve, reject) => {
175
+ this.#resolvePreviousPromise = resolve;
176
+ this.#timeoutId = setTimeout(async () => {
177
+ if (this.options.trailing && this.store.state.lastArgs) try {
178
+ await this.#execute(...this.store.state.lastArgs);
179
+ } catch (error) {
180
+ reject(error);
181
+ }
182
+ this.#setState({ canLeadingExecute: true });
183
+ this.#resolvePreviousPromise = null;
184
+ resolve(this.store.state.lastResult);
185
+ }, this.#getWait());
186
+ });
187
+ };
188
+ #execute = async (...args) => {
189
+ if (!this.#getEnabled()) return void 0;
190
+ const currentMaybeExecuteCount = this.store.state.maybeExecuteCount + 1;
191
+ try {
192
+ this.#setState({ isExecuting: true });
193
+ const currentAsyncRetryer = new AsyncRetryer(this.fn, this.options.asyncRetryerOptions);
194
+ this.asyncRetryers.set(currentMaybeExecuteCount, currentAsyncRetryer);
195
+ const result = await currentAsyncRetryer.execute(...args);
196
+ this.#setState({
197
+ lastResult: result,
198
+ successCount: this.store.state.successCount + 1
199
+ });
200
+ this.options.onSuccess?.(result, args, this);
201
+ } catch (error) {
202
+ this.#setState({ errorCount: this.store.state.errorCount + 1 });
203
+ this.options.onError?.(error, args, this);
204
+ if (this.options.throwOnError) throw error;
205
+ } finally {
206
+ this.asyncRetryers.delete(currentMaybeExecuteCount);
207
+ this.#setState({
208
+ isExecuting: false,
209
+ isPending: false,
210
+ lastArgs: void 0,
211
+ settleCount: this.store.state.settleCount + 1
212
+ });
213
+ this.options.onSettled?.(args, this);
214
+ }
215
+ return this.store.state.lastResult;
216
+ };
217
+ /**
218
+ * Processes the current pending execution immediately
219
+ */
220
+ flush = async () => {
221
+ if (this.store.state.isPending && this.store.state.lastArgs) {
222
+ const { lastArgs } = this.store.state;
223
+ this.#cancelPendingExecution();
224
+ return await this.#execute(...lastArgs);
225
+ }
226
+ };
227
+ #resolvePreviousPromiseInternal = () => {
228
+ if (this.#resolvePreviousPromise) {
229
+ this.#resolvePreviousPromise(this.store.state.lastResult);
230
+ this.#resolvePreviousPromise = null;
231
+ }
232
+ };
233
+ #clearTimeout = () => {
234
+ if (this.#timeoutId) {
235
+ clearTimeout(this.#timeoutId);
236
+ this.#timeoutId = null;
237
+ }
238
+ };
252
239
  /**
253
240
  * Internal cancel without resetting the leading execute state
254
241
  */
255
- #cancelPendingExecution;
242
+ #cancelPendingExecution = () => {
243
+ this.#clearTimeout();
244
+ this.#resolvePreviousPromiseInternal();
245
+ this.#setState({
246
+ isPending: false,
247
+ lastArgs: void 0
248
+ });
249
+ };
250
+ /**
251
+ * Returns the AbortSignal for a specific execution.
252
+ * If no maybeExecuteCount is provided, returns the signal for the most recent execution.
253
+ * Returns null if no execution is found or not currently executing.
254
+ *
255
+ * @param maybeExecuteCount - Optional specific execution to get signal for
256
+ * @example
257
+ * ```typescript
258
+ * const debouncer = new AsyncDebouncer(
259
+ * async (searchTerm: string) => {
260
+ * const signal = debouncer.getAbortSignal()
261
+ * if (signal) {
262
+ * const response = await fetch(`/api/search?q=${searchTerm}`, { signal })
263
+ * return response.json()
264
+ * }
265
+ * },
266
+ * { wait: 300 }
267
+ * )
268
+ * ```
269
+ */
270
+ getAbortSignal = (maybeExecuteCount) => {
271
+ const count = maybeExecuteCount ?? this.store.state.maybeExecuteCount;
272
+ return this.asyncRetryers.get(count)?.getAbortSignal() ?? null;
273
+ };
274
+ /**
275
+ * Aborts all ongoing executions with the internal abort controllers.
276
+ * Does NOT cancel any pending execution that have not started yet.
277
+ */
278
+ abort = () => {
279
+ this.asyncRetryers.forEach((retryer) => retryer.abort());
280
+ this.asyncRetryers.clear();
281
+ this.#setState({ isExecuting: false });
282
+ };
283
+ /**
284
+ * Cancels any pending execution that have not started yet.
285
+ * Does NOT abort any execution already in progress.
286
+ */
287
+ cancel = () => {
288
+ this.#cancelPendingExecution();
289
+ this.#setState({ canLeadingExecute: true });
290
+ };
291
+ /**
292
+ * Resets the debouncer state to its default values
293
+ */
294
+ reset = () => {
295
+ this.#setState(getDefaultAsyncDebouncerState());
296
+ this.asyncRetryers.forEach((retryer) => retryer.reset());
297
+ };
256
298
  };
257
299
  /**
258
300
  * Creates an async debounced function that delays execution until after a specified wait time.
@@ -323,5 +365,4 @@ function asyncDebounce(fn, initialOptions) {
323
365
  }
324
366
 
325
367
  //#endregion
326
- export { AsyncDebouncer, asyncDebounce, asyncDebouncerOptions };
327
- //# sourceMappingURL=async-debouncer.js.map
368
+ export { AsyncDebouncer, asyncDebounce, asyncDebouncerOptions };
@@ -1,9 +1,8 @@
1
1
  import { AsyncRetryer, AsyncRetryerOptions } from "./async-retryer.js";
2
2
  import { QueuePosition } from "./queuer.js";
3
3
  import { Store } from "@tanstack/store";
4
-
5
4
  //#region src/async-queuer.d.ts
6
- interface AsyncQueuerState<TValue> {
5
+ export interface AsyncQueuerState<TValue> {
7
6
  /**
8
7
  * Items currently being processed by the queuer
9
8
  */
@@ -19,7 +18,7 @@ interface AsyncQueuerState<TValue> {
19
18
  /**
20
19
  * Number of times execute has been called
21
20
  */
22
- executeCount: number;
21
+ executionCount: number;
23
22
  /**
24
23
  * Number of items that have been removed from the queue due to expiration
25
24
  */
@@ -67,7 +66,7 @@ interface AsyncQueuerState<TValue> {
67
66
  /**
68
67
  * Number of task executions that have completed (either successfully or with errors)
69
68
  */
70
- settledCount: number;
69
+ settleCount: number;
71
70
  /**
72
71
  * Number of items currently in the queue
73
72
  */
@@ -81,7 +80,7 @@ interface AsyncQueuerState<TValue> {
81
80
  */
82
81
  successCount: number;
83
82
  }
84
- interface AsyncQueuerOptions<TValue> {
83
+ export interface AsyncQueuerOptions<TValue> {
85
84
  /**
86
85
  * Options for configuring the underlying async retryer
87
86
  */
@@ -181,7 +180,7 @@ interface AsyncQueuerOptions<TValue> {
181
180
  /**
182
181
  * Utility function for sharing common `AsyncQueuerOptions` options between different `AsyncQueuer` instances.
183
182
  */
184
- declare function asyncQueuerOptions<TValue = any, TOptions extends Partial<AsyncQueuerOptions<TValue>> = Partial<AsyncQueuerOptions<TValue>>>(options: TOptions): TOptions;
183
+ export declare function asyncQueuerOptions<TValue = any, TOptions extends Partial<AsyncQueuerOptions<TValue>> = Partial<AsyncQueuerOptions<TValue>>>(options: TOptions): TOptions;
185
184
  /**
186
185
  * A flexible asynchronous queue for processing tasks with configurable concurrency, priority, and expiration.
187
186
  *
@@ -246,7 +245,7 @@ declare function asyncQueuerOptions<TValue = any, TOptions extends Partial<Async
246
245
  * asyncQueuer.start();
247
246
  * ```
248
247
  */
249
- declare class AsyncQueuer<TValue> {
248
+ export declare class AsyncQueuer<TValue> {
250
249
  #private;
251
250
  fn: (item: TValue) => Promise<any>;
252
251
  readonly store: Store<Readonly<AsyncQueuerState<TValue>>>;
@@ -261,6 +260,7 @@ declare class AsyncQueuer<TValue> {
261
260
  /**
262
261
  * Adds an item to the queue. If the queue is full, the item is rejected and onReject is called.
263
262
  * Items can be inserted based on priority or at the front/back depending on configuration.
263
+ * `undefined` cannot be queued (it is the internal "no item" sentinel) and is always rejected.
264
264
  *
265
265
  * @example
266
266
  * ```ts
@@ -340,10 +340,10 @@ declare class AsyncQueuer<TValue> {
340
340
  clear: () => void;
341
341
  /**
342
342
  * Returns the AbortSignal for a specific execution.
343
- * If no executeCount is provided, returns the signal for the most recent execution.
343
+ * If no executionCount is provided, returns the signal for the most recent execution.
344
344
  * Returns null if no execution is found or not currently executing.
345
345
  *
346
- * @param executeCount - Optional specific execution to get signal for
346
+ * @param executionCount - Optional specific execution to get signal for
347
347
  * @example
348
348
  * ```typescript
349
349
  * const queuer = new AsyncQueuer(
@@ -358,7 +358,7 @@ declare class AsyncQueuer<TValue> {
358
358
  * )
359
359
  * ```
360
360
  */
361
- getAbortSignal: (executeCount?: number) => AbortSignal | null;
361
+ getAbortSignal: (executionCount?: number) => AbortSignal | null;
362
362
  /**
363
363
  * Aborts all ongoing executions with the internal abort controllers.
364
364
  * Does NOT clear out the items.
@@ -434,7 +434,5 @@ declare class AsyncQueuer<TValue> {
434
434
  * enqueue('hello');
435
435
  * ```
436
436
  */
437
- declare function asyncQueue<TValue>(fn: (value: TValue) => Promise<any>, initialOptions: AsyncQueuerOptions<TValue>): (item: TValue, position?: QueuePosition, runOnItemsChange?: boolean) => boolean;
438
- //#endregion
439
- export { AsyncQueuer, AsyncQueuerOptions, AsyncQueuerState, asyncQueue, asyncQueuerOptions };
440
- //# sourceMappingURL=async-queuer.d.ts.map
437
+ export declare function asyncQueue<TValue>(fn: (value: TValue) => Promise<any>, initialOptions: AsyncQueuerOptions<TValue>): (item: TValue, position?: QueuePosition, runOnItemsChange?: boolean) => boolean;
438
+ //#endregion