UNPKG

@re-shell/cli

Version:

Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja

92 lines (91 loc) 3.08 kB
import * as chokidar from 'chokidar'; import { EventEmitter } from 'events'; export interface PlatformCapabilities { platform: NodeJS.Platform; architecture: string; supportsNativeWatching: boolean; supportsPolling: boolean; supportsFSEvents: boolean; supportsInotify: boolean; maxWatchedFiles: number; recommendedWatchMethod: WatchMethod; fallbackMethods: WatchMethod[]; limitations: string[]; } export type WatchMethod = 'native' | 'polling' | 'fsevents' | 'inotify' | 'hybrid'; export interface WatcherFallbackOptions { primaryMethod: WatchMethod; fallbackMethods: WatchMethod[]; fallbackDelay: number; maxRetries: number; healthCheckInterval: number; enableFallbackLogging: boolean; platformOptimizations: boolean; adaptivePolling: boolean; } export interface PlatformWatchOptions { usePolling?: boolean; interval?: number; binaryInterval?: number; useNativeWatcher?: boolean; enableFallbacks?: boolean; fallbackOptions?: Partial<WatcherFallbackOptions>; platformSpecific?: { darwin?: any; linux?: any; win32?: any; [key: string]: any; }; } export declare class PlatformWatcher extends EventEmitter { private capabilities; private activeWatchers; private fallbackWatchers; private watcherHealth; private fallbackOptions; private healthCheckTimer; private isActive; constructor(fallbackOptions?: Partial<WatcherFallbackOptions>); private detectPlatformCapabilities; private getLinuxMaxWatchedFiles; createWatcher(watchPath: string, options?: PlatformWatchOptions): Promise<chokidar.FSWatcher>; private applyPlatformOptimizations; private createPrimaryWatcher; private createHybridWatcher; private setupFallbackWatcher; private createFallbackWatcher; private getAdaptivePollingInterval; private setupWatcherHealthMonitoring; private activateFallback; private setupHealthChecking; private performHealthCheck; getPlatformCapabilities(): PlatformCapabilities; getWatcherHealth(watcherId?: string): Map<string, WatcherHealthStatus> | WatcherHealthStatus | null; getActiveWatchersCount(): number; closeAll(): Promise<void>; private generateWatcherId; testPlatformCapabilities(): Promise<PlatformTestResult>; } export interface WatcherHealthStatus { isHealthy: boolean; lastCheck: number; failureCount: number; fallbackReady: boolean; lastError?: any; fallbackOptions?: { watchPath: string; options: any; }; } export interface PlatformTestResult { platform: NodeJS.Platform; nativeWatching: boolean; polling: boolean; fsevents: boolean; inotify: boolean; maxWatchedFiles: number; recommendations: string[]; } export declare function createPlatformWatcher(options?: Partial<WatcherFallbackOptions>): PlatformWatcher; export declare function testPlatformWatching(): Promise<PlatformTestResult>; export declare function getPlatformCapabilities(): PlatformCapabilities;