/** * Content Extraction Utilities * * Shared utilities for extracting and processing content from web pages. * Used by ContentIntelligence and site handlers. */ import type { ContentMapping } from '../types/api-patterns.js'; import { detectPageLanguage as detectLanguage, type LanguageDetectionResult, type FieldCategory } from './language-aware-extraction.js'; export { detectLanguage as detectPageLanguage }; export type { LanguageDetectionResult, FieldCategory }; /** * Get a value from an object using dot notation path * Supports array access like "items[0].title" */ export declare function getValueAtPath(obj: unknown, path: string): unknown; /** * Check if an object has a field at the given path (supports dot notation and array access) */ export declare function hasFieldAtPath(obj: unknown, path: string): boolean; /** * Get a string value from an object at the given path */ export declare function getStringAtPath(obj: unknown, path: string): string | null; /** * Check if a string contains HTML content */ export declare function isHtmlContent(str: string): boolean; /** * Simple HTML to plain text converter */ export declare function htmlToPlainText(html: string): string; /** * Extract text content from structured data */ export declare function extractTextFromStructured(data: unknown): string; /** * Extract text recursively from an object, filtering out code/URLs */ export declare function extractTextFromObject(obj: unknown, depth?: number): string; /** * Extract content from API response using contentMapping * Handles HTML content by converting to plain text and markdown */ export declare function extractContentFromMapping(data: unknown, mapping: ContentMapping, turndownFn?: (html: string) => string): { title: string; text: string; markdown: string; }; /** * Confidence thresholds for pattern application */ export declare const PATTERN_CONFIDENCE: { readonly MIN: 0.3; readonly MEDIUM: 0.5; readonly HIGH: 0.8; }; /** * Get confidence level string from numeric score */ export declare function getConfidenceLevel(confidence: number): 'high' | 'medium' | 'low'; /** * Extract text content from structured data with language awareness * * Tries field names in the detected language first, then falls back to English. * This enables extraction from multilingual content like government portals. * * @param data - The data object to extract from * @param language - The detected page language (ISO 639-1 code) * @returns Extracted text content */ export declare function extractTextFromStructuredLanguageAware(data: unknown, language: string): string; /** * Extract content from API response using contentMapping with language awareness * * First tries the mapping as-is, then tries language-specific field variants * * @param data - The data object to extract from * @param mapping - The content mapping * @param language - The detected page language * @param turndownFn - Optional HTML to markdown converter * @returns Extracted title, text, and markdown */ export declare function extractContentFromMappingLanguageAware(data: unknown, mapping: ContentMapping, language: string, turndownFn?: (html: string) => string): { title: string; text: string; markdown: string; }; //# sourceMappingURL=content-extraction-utils.d.ts.map