@plyaz/types 1.4.1 → 1.5.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.
@@ -333,7 +333,7 @@ export interface CreateBatchProcessorReturn<T> {
333
333
  */
334
334
  export interface CreateBatchTestHelperReturn<T> {
335
335
  generateOperations(count: number, distribution?: Partial<Record<OperationType, number>>): Operation<T>[];
336
- simulateFailures(processor: Vitest.Mock, failureRate: number, error?: Error): void;
336
+ simulateFailures(processor: Vitest.MockInstance, failureRate: number, error?: Error): void;
337
337
  assertBatchResult(result: BatchOperationResult<T>, expectations: {
338
338
  minSuccessRate?: number;
339
339
  maxDuration?: number;
@@ -390,7 +390,7 @@ export interface CreateBatchTestHelperReturn<T> {
390
390
  * ```
391
391
  */
392
392
  export interface CreateMockBatchHandlerReturn<T> {
393
- handler: Vitest.Mock<(operation: Operation<T>) => Promise<T>>;
393
+ handler: Vitest.MockInstance<(operation: Operation<T>) => Promise<T>>;
394
394
  getProcessedOperations: () => Operation<T>[];
395
395
  getResults: () => Map<string, T>;
396
396
  clear: () => void;
@@ -572,3 +572,20 @@ export interface StressTestConfig {
572
572
  concurrency?: number;
573
573
  operationMix?: Record<string, number>;
574
574
  }
575
+ /**
576
+ * Process with retry parameters
577
+ * @interface ProcessWithRetryParams
578
+ * @typeParam T - Type of operation data
579
+ */
580
+ export interface ProcessWithRetryParams<T> {
581
+ /** Operation to process */
582
+ operation: unknown;
583
+ /** Processing function */
584
+ processFn: (operation: unknown) => Promise<T> | T;
585
+ /** Number of retry attempts */
586
+ retryCount: number;
587
+ /** Delay between retries */
588
+ retryDelay: number;
589
+ /** Operation timeout */
590
+ timeout: number;
591
+ }