intertools
Version:
🚀 Professional development assistant with Backend Engineer Mode. Auto-starts with full functionality, no prompts, iterative problem solving. Features: AI chat orchestrator, terminal monitoring, file analysis, error correction, performance optimization. C
171 lines • 3.96 kB
TypeScript
export interface LocalhostData {
url: string;
html: string;
consoleLogs: ConsoleLogEntry[];
networkRequests: NetworkRequest[];
performance: PerformanceMetrics;
domAnalysis: DOMAnalysis;
errors: ErrorEntry[];
}
export interface ConsoleLogEntry {
type: 'log' | 'error' | 'warn' | 'info' | 'debug';
message: string;
timestamp: Date;
source?: string;
stack?: string;
args?: any[];
}
export interface NetworkRequest {
url: string;
method: string;
status: number;
statusText: string;
responseTime: number;
timestamp: Date;
requestHeaders?: Record<string, string>;
responseHeaders?: Record<string, string>;
size: number;
type: 'xhr' | 'fetch' | 'resource' | 'document';
}
export interface PerformanceMetrics {
loadTime: number;
domContentLoaded: number;
firstContentfulPaint: number;
largestContentfulPaint: number;
cumulativeLayoutShift: number;
firstInputDelay: number;
memoryUsage: number;
domNodes: number;
resourceCount: number;
totalSize: number;
}
export interface DOMAnalysis {
totalElements: number;
elementsByTag: Record<string, number>;
classNames: string[];
ids: string[];
forms: FormInfo[];
images: ImageInfo[];
links: LinkInfo[];
scripts: ScriptInfo[];
stylesheets: StylesheetInfo[];
}
export interface FormInfo {
action: string;
method: string;
inputs: number;
id?: string;
className?: string;
}
export interface ImageInfo {
src: string;
alt?: string;
width?: number;
height?: number;
loading?: string;
}
export interface LinkInfo {
href: string;
text: string;
target?: string;
rel?: string;
}
export interface ScriptInfo {
src?: string;
type?: string;
async?: boolean;
defer?: boolean;
inline: boolean;
size: number;
}
export interface StylesheetInfo {
href?: string;
media?: string;
inline: boolean;
size: number;
}
export interface ErrorEntry {
type: 'javascript' | 'network' | 'console' | 'resource';
message: string;
source?: string;
line?: number;
column?: number;
timestamp: Date;
stack?: string;
}
export declare class LocalhostMonitor {
private isMonitoring;
private monitoredUrls;
private capturedData;
constructor();
/**
* Start monitoring a localhost URL
*/
startMonitoring(url: string): Promise<void>;
/**
* Stop monitoring a URL
*/
stopMonitoring(url: string): void;
/**
* Stop all monitoring
*/
stopAllMonitoring(): void;
/**
* Get captured data for a URL
*/
getLocalhostData(url: string): LocalhostData | null;
/**
* Get all captured data
*/
getAllData(): Map<string, LocalhostData>;
/**
* Monitor localhost development server
*/
monitorLocalhost(url: string): Promise<LocalhostData>;
/**
* Capture localhost data
*/
private captureLocalhostData;
/**
* Fetch HTML content from localhost
*/
private fetchHTML;
/**
* Capture console logs (simulated)
*/
private captureConsoleLogs;
/**
* Capture network requests (simulated)
*/
private captureNetworkRequests;
/**
* Measure performance metrics (simulated)
*/
private measurePerformance;
/**
* Analyze DOM structure
*/
private analyzeDOMStructure;
/**
* Capture errors (simulated)
*/
private captureErrors;
/**
* Get simulated localhost data for demo
*/
private getSimulatedLocalhostData;
/**
* Get monitoring statistics
*/
getStats(): {
monitoredUrls: number;
totalRequests: number;
totalErrors: number;
averageLoadTime: number;
mostCommonErrors: {
message: string;
count: number;
}[];
};
}
//# sourceMappingURL=localhost-monitor.d.ts.map