UNPKG

apple-hig-mcp

Version:

High-performance MCP server providing instant access to Apple's Human Interface Guidelines via hybrid static/dynamic content delivery

91 lines 2.46 kB
/** * HIGContentExtractor * * Specialized service for extracting high-quality content from Apple's HIG pages * with advanced quality scoring and validation to achieve 95%+ real content SLA. */ import type { HIGSection } from '../types.js'; export interface ContentQualityMetrics { score: number; length: number; structureScore: number; appleTermsScore: number; codeExamplesCount: number; imageReferencesCount: number; headingCount: number; isFallbackContent: boolean; extractionMethod: string; confidence: number; } export interface ProcessedContent { content: string; summary: string; tableOfContents: string; codeExamples: string[]; imageReferences: string[]; relatedSections: string[]; keywords: string[]; quality: ContentQualityMetrics; } export declare class HIGContentExtractor { private appleDesignTerms; private applePlatformTerms; private fallbackIndicators; /** * Extract and process content from raw HTML or text */ extractContent(rawContent: string, section: HIGSection): Promise<ProcessedContent>; /** * Clean and normalize raw content */ private cleanRawContent; /** * Extract code examples from content */ private extractCodeExamples; /** * Extract image references from content */ private extractImageReferences; /** * Extract headings from content */ private extractHeadings; /** * Extract related sections from content */ private extractRelatedSections; /** * Extract keywords from content */ private extractKeywords; /** * Generate table of contents from headings */ private generateTableOfContents; /** * Generate content summary */ private generateSummary; /** * Calculate comprehensive quality metrics */ private calculateQualityMetrics; /** * Calculate confidence in the extracted content */ private calculateConfidence; /** * Check if a word is a stop word */ private isStopWord; /** * Validate content meets minimum quality standards */ isHighQualityContent(metrics: ContentQualityMetrics): boolean; /** * Generate quality report for debugging */ generateQualityReport(metrics: ContentQualityMetrics, section: HIGSection): string; } //# sourceMappingURL=hig-content-extractor.service.d.ts.map