/** * Base Operation Tracker * * Abstract base class for tracking operations across the API. * Provides common functionality that can be extended by domain-specific trackers. */ import { QueueFactory } from './QueueFactory'; import type { QueueSystem } from './QueueSystem'; import type { QueueStats, PriorityLevelValue, BaseOperation } from '@plyaz/types/api'; /** * Operation priority detection function type */ export type PriorityDetector = (operation: T) => PriorityLevelValue; /** * Source detection function type */ export type SourceDetector = () => string; /** * Abstract base class for operation trackers */ export declare abstract class BaseOperationTracker { protected readonly queueName: string; protected readonly priorityDetector: PriorityDetector; protected readonly sourceDetector: SourceDetector; protected queue: ReturnType> | null; protected processor?: (op: T) => void | Promise; protected isReady: boolean; constructor(queueName: string, priorityDetector: PriorityDetector, sourceDetector: SourceDetector); /** * Get or create the queue */ protected getQueue(): QueueSystem; /** * Track an operation */ track(operation: string, event: string, metadata?: Record, options?: { priority?: PriorityLevelValue; source?: string; }): void; /** * Create an operation object - can be overridden by subclasses */ protected createOperation(operation: string, event: string, metadata: Record, options?: { priority?: PriorityLevelValue; source?: string; }): T; /** * Set the processor for operations */ setProcessor(processor: (op: T) => void | Promise): void; /** * Process a single operation */ protected processOperation(op: { data: T; }): Promise; /** * Handle processing errors - can be overridden by subclasses */ protected handleProcessingError(error: unknown, operation: T): void; /** * Get queue statistics */ getStats(): QueueStats; /** * Reset the tracker */ reset(): void; /** * Check if ready to process */ isProcessorReady(): boolean; /** * Get queue name */ getQueueName(): string; } /** * Default priority detection based on operation and event strings */ export declare function createDefaultPriorityDetector(): PriorityDetector; /** * Default source detection using stack trace analysis */ export declare function createDefaultSourceDetector(): SourceDetector; //# sourceMappingURL=BaseOperationTracker.d.ts.map