// Type declaration for the optional peer dependency @intuned/browser. // This package is only needed at type level: the `download` file source accepts // the return value of `downloadFile` (a Playwright `Download`). When the real // package is installed, its actual types are used instead of these. declare module "@intuned/browser" { import type { Download, Locator, Page } from "playwright"; export type { Download }; export type Trigger = string | Locator | ((page: Page) => Promise); export function downloadFile(input: { page: Page; trigger: Trigger; timeoutInMs?: number; }): Promise; // Add other exports from @intuned/browser if needed } // Type declaration for the `@intuned/browser/ai` subpath, used by // `extractStructuredDataFromFile` (which converts the file to markdown and then runs // the browser SDK's structured-data extractor over it via a dynamic import). // These declarations are only a fallback for type-checking when the real // package is not installed; when it is, its actual types are used instead. declare module "@intuned/browser/ai" { import type { z } from "zod"; /** * A JSON Schema object describing the shape of the data to extract. */ export interface JsonSchema { type: "string" | "number" | "integer" | "boolean" | "array" | "object"; description?: string; properties?: Record; required?: string[]; items?: JsonSchema; enum?: unknown[]; [key: string]: unknown; } export type TextContentItem = { type: "text"; data: string }; export type ContentItem = TextContentItem | { type: string; data: unknown }; export function extractStructuredData(options: { content: ContentItem | ContentItem[]; dataSchema: JsonSchema | z.ZodSchema; prompt?: string; maxRetries?: number; enableCache?: boolean; model?: string; apiKey?: string; }): Promise; }