@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
80 lines • 1.96 kB
TypeScript
/**
* Schema Markup Analysis and Validation
*/
import { Page } from 'playwright';
export interface SchemaMarkup {
type: string;
context?: string;
properties: Record<string, any>;
errors: string[];
warnings: string[];
isValid: boolean;
location: {
selector: string;
line?: number;
column?: number;
};
}
export interface SchemaAnalysisResult {
hasStructuredData: boolean;
totalSchemas: number;
validSchemas: number;
invalidSchemas: number;
schemas: SchemaMarkup[];
recommendations: string[];
score: number;
grade: 'A' | 'B' | 'C' | 'D' | 'F';
supportedTypes: {
found: string[];
recommended: string[];
missing: string[];
};
richSnippetOpportunities: Array<{
type: string;
description: string;
priority: 'high' | 'medium' | 'low';
implementation: string;
}>;
}
export declare class SchemaMarkupAnalyzer {
private commonSchemaTypes;
private requiredProperties;
/**
* Analyze schema markup on a page
*/
analyze(page: Page): Promise<SchemaAnalysisResult>;
/**
* Extract schema markup from page
*/
private extractSchemaMarkup;
/**
* Validate a schema against Schema.org requirements
*/
private validateSchema;
/**
* Analyze supported schema types
*/
private analyzeSupportedTypes;
/**
* Identify rich snippet opportunities
*/
private identifyRichSnippetOpportunities;
/**
* Generate recommendations
*/
private generateRecommendations;
/**
* Calculate schema score
*/
private calculateScore;
/**
* Calculate grade based on score
*/
private calculateGrade;
private isValidUrl;
private isValidEmail;
private isValidPhoneNumber;
private isValidDate;
}
export default SchemaMarkupAnalyzer;
//# sourceMappingURL=schema-markup-analyzer.d.ts.map