UNPKG

@stdbl/wao

Version:

Optimize web pages for LLM agent interaction and understanding

55 lines (52 loc) 2.22 kB
/** * Data flow description */ interface DataFlow { source: string; destination: string; dataType?: string; description?: string; [key: string]: any; } /** * Page structure description */ interface PageStructure { title?: string; mainContent?: string; navigation?: string | string[]; footer?: string; sidebar?: string | string[]; [key: string]: any; } declare global { interface Window { WAO: { activateOptimizer: (domElement: HTMLElement) => void; deactivateOptimizer: () => void; describeElementVisually: (selector: string, description: string, elementType: string) => void; defineInteraction: (elementSelector: string, interactionType: 'click' | 'hover' | 'focus', methodName: string) => void; isActivated: () => boolean; describePage: (pageInfo: Partial<PageStructure>) => void; describeDataFlow: (flow: DataFlow) => void; analyzeAccessibility: () => void; extractSemanticStructure: () => void; highlightElementRole: (selector: string, role: string) => void; }; } } declare const isActivated: () => boolean; declare const activateOptimizer: (domElement: HTMLElement) => void; declare const deactivateOptimizer: () => void; declare const defineInteraction: (elementSelector: string, interactionType: "click" | "hover" | "focus", methodName: string, expectedOutcome?: string) => void; declare const describeElementVisually: (selector: string, description: string, elementType: string, options?: { role?: string; importance?: "primary" | "secondary" | "tertiary"; dataContext?: string; }) => void; declare const describePage: (pageInfo: Partial<PageStructure>) => void; declare const describeDataFlow: (flow: DataFlow) => void; declare const analyzeAccessibility: () => void; declare const extractSemanticStructure: () => void; declare const highlightElementRole: (selector: string, role: string) => void; export { activateOptimizer, analyzeAccessibility, deactivateOptimizer, defineInteraction, describeDataFlow, describeElementVisually, describePage, extractSemanticStructure, highlightElementRole, isActivated };