import type { Scanner } from "../protocol/scanner.js"; import type { ScannerScheduleMode } from "../scanner-definition.js"; import type { ScannerId, StrategyRegistration } from "../types.js"; /** * One scanner runtime registration scoped to one strategy. * PoC constraint: one instance per scanner id within a strategy. */ export interface StrategyScannerRegistration { address: string; strategy: StrategyRegistration; scanner: Scanner; scheduleMode: ScannerScheduleMode; enabled: boolean; initialized: boolean; /** * Start timestamp for the current in-flight run. * Null means no active run for this strategy/scanner key. */ lastScanTime: number | null; intervalSeconds: number; initialConfig: Cfg; nextRunAt: number | null; timer: NodeJS.Timeout | null; } /** In-memory registry for strategy and scanner runtime registrations. */ export declare class StrategyRegistry { private readonly strategies; private readonly scanners; /** Registers or updates strategy metadata. */ registerStrategy(strategy: StrategyRegistration): void; /** Registers one scanner instance for a strategy. */ registerScanner(address: string, scanner: Scanner): StrategyScannerRegistration; /** Looks up one scanner registration by strategy address and scanner id. */ get(address: string, scannerId: ScannerId): StrategyScannerRegistration | undefined; /** Lists scanner registrations, optionally constrained to one strategy. */ list(address?: string): StrategyScannerRegistration[]; /** Enables/disables one scanner registration. */ setEnabled(address: string, scannerId: ScannerId, enabled: boolean): void; /** Marks whether initialize() has been completed for one scanner registration. */ setInitialized(address: string, scannerId: ScannerId, initialized: boolean): void; /** Stores/clears current in-flight run start time for one scanner registration. */ setLastScanTime(address: string, scannerId: ScannerId, lastScanTime: number | null): void; /** Stores scheduler handle for one scanner registration. */ setTimer(address: string, scannerId: ScannerId, timer: NodeJS.Timeout | null): void; /** Stores the next scheduled run timestamp for one scanner registration. */ setNextRunAt(address: string, scannerId: ScannerId, nextRunAt: number | null): void; /** Clears and forgets all active scanner timers. */ clearAllTimers(): void; } //# sourceMappingURL=strategy-registry.d.ts.map