export interface ResourceLimits {
    /** Maximum heap memory in bytes (default: 1GB) */
    maxMemoryBytes?: number;
    /** Maximum number of file handles (default: 1000) */
    maxFileHandles?: number;
    /** Maximum number of cached modules (default: 10000) */
    maxCachedModules?: number;
    /** Check interval in milliseconds (default: 5000) */
    checkInterval?: number;
}
export interface ResourceUsage {
    memoryUsed: number;
    memoryLimit: number;
    memoryPercent: number;
    heapUsed: number;
    heapTotal: number;
    fileHandles: number;
    cachedModules: number;
}
export type ResourceWarningCallback = (_usage: ResourceUsage, _limit: string) => void;
/**
 * Monitor and enforce resource limits to prevent exhaustion
 */
export declare class ResourceLimiter {
    private readonly limits;
    private checkIntervalId?;
    private warningCallbacks;
    private moduleCount;
    private fileHandleCount;
    constructor(limits?: ResourceLimits);
    /**
     * Start monitoring resources
     */
    start(): void;
    /**
     * Stop monitoring resources
     */
    stop(): void;
    /**
     * Register a callback for resource warnings
     */
    onWarning(callback: ResourceWarningCallback): void;
    /**
     * Check if a module can be loaded (respects cache limit)
     */
    canLoadModule(): boolean;
    /**
     * Increment module count
     */
    incrementModules(): void;
    /**
     * Decrement module count
     */
    decrementModules(): void;
    /**
     * Set module count explicitly
     */
    setModuleCount(count: number): void;
    /**
     * Check if a file handle can be opened
     */
    canOpenFile(): boolean;
    /**
     * Increment file handle count
     */
    incrementFileHandles(): void;
    /**
     * Decrement file handle count
     */
    decrementFileHandles(): void;
    /**
     * Get current resource usage
     */
    getUsage(): ResourceUsage;
    /**
     * Check resource limits and trigger warnings
     */
    private checkLimits;
    /**
     * Trigger warning callbacks
     */
    private triggerWarning;
    /**
     * Force garbage collection if available
     */
    forceGC(): void;
}
//# sourceMappingURL=resource-limiter.d.ts.map