@casoon/auditmysite
Version:
Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe
230 lines • 7.46 kB
TypeScript
/**
* đź”’ STRICT AUDIT TYPES - MANDATORY DATA STRUCTURES
*
* Diese Interfaces erzwingen vollständige Datenstrukturen und verbieten
* undefined/null-Werte fĂĽr kritische Felder.
*
* Wenn Daten fehlen, soll das System explizit fehlschlagen,
* nicht mit leeren/Standard-Werten weiterarbeiten.
*/
/**
* Strikte Accessibility Issue - alle Felder verpflichtend
*/
export interface StrictAccessibilityIssue {
readonly code: string;
readonly message: string;
readonly type: 'error' | 'warning' | 'notice';
readonly selector: string | null;
readonly context: string | null;
readonly impact: 'minor' | 'moderate' | 'serious' | 'critical' | null;
readonly help: string | null;
readonly helpUrl: string | null;
}
/**
* Strikte Performance-Metriken - alle Core Web Vitals verpflichtend
*/
export interface StrictPerformanceMetrics {
readonly largestContentfulPaint: number;
readonly firstContentfulPaint: number;
readonly cumulativeLayoutShift: number;
readonly timeToFirstByte: number;
readonly domContentLoaded: number;
readonly loadComplete: number;
readonly firstPaint: number;
}
/**
* Strikte SEO-Daten - alle wichtigen Felder verpflichtend
*/
export interface StrictSEOData {
readonly title: string;
readonly titleLength: number;
readonly description: string;
readonly descriptionLength: number;
readonly keywords: string;
readonly h1Count: number;
readonly h2Count: number;
readonly h3Count: number;
readonly totalImages: number;
readonly imagesWithoutAlt: number;
readonly imagesWithEmptyAlt: number;
}
/**
* Strikte Content-Weight-Daten - alle Resource-Typen verpflichtend
*/
export interface StrictContentWeightData {
readonly totalSize: number;
readonly html: {
size: number;
files: number;
};
readonly css: {
size: number;
files: number;
};
readonly javascript: {
size: number;
files: number;
};
readonly images: {
size: number;
files: number;
};
readonly other: {
size: number;
files: number;
};
}
/**
* Strikte Mobile-Friendliness-Empfehlung - alle Felder verpflichtend
*/
export interface StrictMobileRecommendation {
readonly category: 'Touch Targets' | 'Performance' | 'Media' | 'Forms' | 'Navigation' | 'Content';
readonly priority: 'low' | 'medium' | 'high' | 'critical';
readonly issue: string;
readonly recommendation: string;
readonly impact: string;
}
/**
* Strikte Accessibility-Ergebnisse - keine optionalen Felder
*/
export interface StrictPageAccessibility {
readonly score: number;
readonly errors: readonly StrictAccessibilityIssue[];
readonly warnings: readonly StrictAccessibilityIssue[];
readonly notices: readonly StrictAccessibilityIssue[];
readonly totalIssues: number;
readonly wcagLevel: 'A' | 'AA' | 'AAA' | 'none';
}
/**
* Strikte Performance-Ergebnisse - alle Metriken verpflichtend
*/
export interface StrictPagePerformance {
readonly score: number;
readonly grade: 'A' | 'B' | 'C' | 'D' | 'F';
readonly coreWebVitals: StrictPerformanceMetrics;
readonly issues: readonly string[];
readonly budgetViolations: number;
}
/**
* Strikte SEO-Ergebnisse - alle wichtigen Daten verpflichtend
*/
export interface StrictPageSEO {
readonly score: number;
readonly grade: 'A' | 'B' | 'C' | 'D' | 'F';
readonly metaTags: StrictSEOData;
readonly issues: readonly string[];
readonly recommendations: readonly string[];
}
/**
* Strikte Content-Weight-Ergebnisse - alle Resource-Daten verpflichtend
*/
export interface StrictPageContentWeight {
readonly score: number;
readonly grade: 'A' | 'B' | 'C' | 'D' | 'F';
readonly resources: StrictContentWeightData;
readonly optimizations: readonly string[];
readonly compressionRatio: number;
}
/**
* Strikte Mobile-Friendliness-Ergebnisse - alle Empfehlungen verpflichtend
*/
export interface StrictPageMobileFriendliness {
readonly overallScore: number;
readonly grade: 'A' | 'B' | 'C' | 'D' | 'F';
readonly recommendations: readonly StrictMobileRecommendation[];
readonly touchTargetIssues: number;
readonly responsiveIssues: number;
}
/**
* Strikte Seiten-Ergebnisse - ALLE Analyse-Typen sind verpflichtend
*
* Das System darf keine Seite ohne vollständige Analyse-Ergebnisse akzeptieren.
* Wenn eine Analyse fehlschlägt, muss das explizit als Fehler behandelt werden.
*/
export interface StrictAuditPage {
readonly url: string;
readonly title: string;
readonly status: 'passed' | 'failed' | 'crashed';
readonly duration: number;
readonly testedAt: string;
readonly accessibility: StrictPageAccessibility;
readonly performance: StrictPagePerformance;
readonly seo: StrictPageSEO;
readonly contentWeight: StrictPageContentWeight;
readonly mobileFriendliness: StrictPageMobileFriendliness;
}
/**
* Strikte Audit-Zusammenfassung - alle Zählungen verpflichtend
*/
export interface StrictAuditSummary {
readonly totalPages: number;
readonly testedPages: number;
readonly passedPages: number;
readonly failedPages: number;
readonly crashedPages: number;
readonly redirectPages: number;
readonly totalErrors: number;
readonly totalWarnings: number;
readonly averageScore: number;
readonly overallGrade: 'A' | 'B' | 'C' | 'D' | 'F';
}
/**
* Strikte Audit-Metadaten - alle Felder verpflichtend
*/
export interface StrictAuditMetadata {
readonly version: string;
readonly timestamp: string;
readonly sitemapUrl: string;
readonly toolVersion: string;
readonly duration: number;
readonly configuration: {
readonly maxPages: number;
readonly timeout: number;
readonly standard: string;
readonly features: readonly string[];
};
}
/**
* HAUPT-INTERFACE: Strikte Audit-Daten
*
* Dieses Interface erzwingt vollständige Daten für alle Bereiche.
* Keine optionalen Felder, keine undefined-Werte.
*/
export interface StrictAuditData {
readonly metadata: StrictAuditMetadata;
readonly summary: StrictAuditSummary;
readonly pages: readonly StrictAuditPage[];
readonly systemPerformance: {
readonly testCompletionTimeSeconds: number;
readonly averageTimePerPageMs: number;
readonly throughputPagesPerMinute: number;
readonly memoryUsageMB: number;
readonly efficiency: number;
};
}
/**
* Type Guard: PrĂĽft ob ein Objekt StrictAuditData ist
*/
export declare function isStrictAuditData(data: any): data is StrictAuditData;
/**
* Type Guard: PrĂĽft ob eine Seite alle verpflichtenden Analysen hat
*/
export declare function hasCompleteAnalysis(page: any): page is StrictAuditPage;
/**
* Fehler für unvollständige Audit-Daten
*/
export declare class IncompleteAuditDataError extends Error {
readonly missingFields: string[];
readonly pageUrl?: string | undefined;
constructor(message: string, missingFields: string[], pageUrl?: string | undefined);
}
/**
* Fehler fĂĽr fehlende Analyse-Ergebnisse
*/
export declare class MissingAnalysisError extends Error {
readonly analysisType: string;
readonly pageUrl: string;
readonly reason?: string | undefined;
constructor(analysisType: string, pageUrl: string, reason?: string | undefined);
}
//# sourceMappingURL=strict-audit-types.d.ts.map