import { Logger } from 'pino'; import { ScanController } from '../../../utils/scanner.js'; import { TrafficSniffer } from '../../trackers/traffic-sniffer.js'; import type { IScanOptions, IScanReport } from '../../../types/public.js'; /** * Service responsible for managing Modbus device scanning operations. * Supports both RTU (Serial) and TCP (Network) scanning. */ export declare class ScanService { private _activeController; private _isScanning; private readonly _scanner; /** * @param {Logger} logger - Pino logger instance for scan activity. * @param {TrafficSniffer} [sniffer] - Optional sniffer for debugging raw traffic during scans. */ constructor(logger: Logger, sniffer?: TrafficSniffer); /** Indicates whether a scanning process is currently active. */ get isScanning(): boolean; /** Pauses the current scanning operation. */ pause(): void; /** Resumes a paused scanning operation. */ resume(): void; /** Stops the current scanning operation immediately. */ stop(): void; /** * Starts a Modbus RTU scan. * Automatically detects if the environment is Node.js or WebSerial based on options. * * @param {IScanOptions} options - Scanning parameters (baud rates, slave IDs, etc.). * @param {ScanController} [controller] - Optional external controller to manage the scan state. * @returns {Promise} Results of the scan. * @throws {Error} If another scan is already in progress. */ scanRtu(options: IScanOptions, controller?: ScanController): Promise; /** * Starts a Modbus TCP scan. * * @param {IScanOptions} options - Scanning parameters (hosts, ports, unit IDs). * @param {ScanController} [controller] - Optional external controller. * @returns {Promise} Results of the scan. * @throws {Error} If another scan is already in progress. */ scanTcp(options: IScanOptions, controller?: ScanController): Promise; /** * Internal helper to determine if the scan should use Node SerialPort or WebSerial API. * @private */ private _detectRtuTransportType; }