@plyaz/types 1.5.1 → 1.5.3

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.MockInstance, failureRate: number, error?: Error): void;
336
+ simulateFailures(processor: Vitest.Mock, 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.MockInstance<(operation: Operation<T>) => Promise<T>>;
393
+ handler: Vitest.Mock<(operation: Operation<T>) => Promise<T>>;
394
394
  getProcessedOperations: () => Operation<T>[];
395
395
  getResults: () => Map<string, T>;
396
396
  clear: () => void;
@@ -573,19 +573,37 @@ export interface StressTestConfig {
573
573
  operationMix?: Record<string, number>;
574
574
  }
575
575
  /**
576
- * Process with retry parameters
577
- * @interface ProcessWithRetryParams
578
- * @typeParam T - Type of operation data
576
+ * Parameters for processing operations with retry logic.
577
+ * Configures retry behavior for resilient operation execution.
578
+ *
579
+ * @template T - Type of operation data
580
+ *
581
+ * @example
582
+ * ```typescript
583
+ * const params: ProcessWithRetryParams<UserData> = {
584
+ * operation: {
585
+ * id: 'op-123',
586
+ * type: 'create',
587
+ * data: { name: 'John', email: 'john@example.com' }
588
+ * },
589
+ * processFn: async (op) => {
590
+ * return await apiClient.createUser(op.data);
591
+ * },
592
+ * retryCount: 3,
593
+ * retryDelay: 1000,
594
+ * timeout: 5000
595
+ * };
596
+ * ```
579
597
  */
580
598
  export interface ProcessWithRetryParams<T> {
581
599
  /** Operation to process */
582
- operation: unknown;
583
- /** Processing function */
584
- processFn: (operation: unknown) => Promise<T> | T;
600
+ operation: Operation<T>;
601
+ /** Function to process the operation */
602
+ processFn: (operation: Operation<T>) => Promise<T> | T;
585
603
  /** Number of retry attempts */
586
604
  retryCount: number;
587
- /** Delay between retries */
605
+ /** Delay between retries in milliseconds */
588
606
  retryDelay: number;
589
- /** Operation timeout */
607
+ /** Operation timeout in milliseconds */
590
608
  timeout: number;
591
609
  }