import { DataSource } from './source-base';
import { WellKnownMetadata } from '../../constants';
type SitemapFilterContext = {
    url: string;
    lastmod?: string;
    changefreq?: string;
    priority?: string;
};
type FetchResult = {
    url: string;
    contentType: string;
    content: string;
    metadata?: {
        [WellKnownMetadata.knowledge.TITLE]?: string;
        [WellKnownMetadata.knowledge.DESCRIPTION]?: string;
        [WellKnownMetadata.knowledge.FAVICON]?: string;
    };
};
/**
 * Fetch strategy for retrieving web content
 *
 * - 'node:fetch': Uses Node's built-in fetch (fast, no dependencies, works for static HTML)
 * - 'integration:browser': Uses browser integration (slower, requires browser integration, handles JavaScript/SPAs)
 */
type FetchStrategy = 'node:fetch' | 'integration:browser';
/**
 * Fetch option can be:
 * - A strategy string: 'node:fetch' or 'integration:browser'
 * - A custom function: for special authentication, headers, or processing
 */
type FetchOption = FetchStrategy | ((url: string) => Promise<FetchResult> | FetchResult);
type WebsiteSourceOptions = {
    id?: string;
    filter?: (context: SitemapFilterContext) => boolean;
    /**
     * Fetch method to use for retrieving web pages
     *
     * Options:
     * - 'node:fetch': Fast, uses Node's built-in fetch (best for static HTML sites) **[DEFAULT]**
     * - 'integration:browser': Slower, uses browser integration (best for JavaScript/SPAs)
     * - Custom function: Provide your own fetch implementation (for auth, special headers, etc.)
     * - undefined: Defaults to 'node:fetch'
     *
     * @default 'node:fetch'
     *
     * @example
     * // Use Node's built-in fetch (default, can be omitted)
     * { fetch: 'node:fetch' }
     *
     * @example
     * // Use browser integration for JavaScript-heavy sites
     * { fetch: 'integration:browser' }
     *
     * @example
     * // Custom fetch with authentication
     * {
     *   fetch: async (url) => {
     *     const response = await fetch(url, {
     *       headers: { Authorization: 'Bearer token' }
     *     })
     *     return {
     *       url,
     *       contentType: 'text/html',
     *       content: await response.text()
     *     }
     *   }
     * }
     */
    fetch?: FetchOption;
    maxPages?: number;
    maxDepth?: number;
};
type UrlsSourceOptions = {
    id?: string;
    /**
     * Fetch method to use for retrieving web pages
     *
     * See WebsiteSourceOptions.fetch for detailed documentation
     */
    fetch?: FetchOption;
};
export declare class WebsiteSource extends DataSource {
    private mode;
    private baseUrl;
    private sitemapUrl;
    private llmsTxtUrl;
    private urls;
    private filterFn;
    private customFetch;
    private fetchStrategy;
    private maxPages;
    private maxDepth;
    private transformFn;
    private constructor();
    /** Get serializable configuration for change detection (only user-provided options) */
    getConfig(): Record<string, unknown>;
    private isBrowserIntegrationAvailable;
    /**
     * Convert HtmlMetadata to FetchResult metadata format
     */
    private convertMetadata;
    /**
     * Default fetch implementation using Node's built-in fetch
     */
    private defaultFetch;
    /**
     * Fetch content from a URL for sitemap parsing (raw content needed)
     */
    private fetchRaw;
    /**
     * Fetch content from a URL for indexing (with metadata extraction)
     */
    private fetchUrl;
    /**
     * Fetch content using the browser integration
     */
    private fetchWithBrowserIntegration;
    /**
     * Parse sitemap XML content
     */
    private parseSitemapXml;
    /**
     * Parse sitemap TXT content
     */
    private parseSitemapTxt;
    private parseLlmsTxt;
    /**
     * Discover URLs from a website using browser integration
     */
    private discoverUrlsFromWebsite;
    /**
     * Discover all URLs from sitemap with depth and page limits
     */
    private discoverUrls;
    get syncWorkflow(): import("../workflow").BaseWorkflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
        dsId: import("@bpinternal/zui").ZodString;
        kbName: import("@bpinternal/zui").ZodString;
        kbId: import("@bpinternal/zui").ZodString;
        force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
    }, "strip", {
        kbId: string;
        kbName: string;
        dsId: string;
        force: boolean;
    }, {
        kbId: string;
        kbName: string;
        dsId: string;
        force?: boolean | undefined;
    }>, import("@bpinternal/zui").ZodObject<{
        processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
        added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
            file: import("@bpinternal/zui").ZodString;
            name: import("@bpinternal/zui").ZodString;
            hash: import("@bpinternal/zui").ZodString;
            size: import("@bpinternal/zui").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
            file: import("@bpinternal/zui").ZodString;
            name: import("@bpinternal/zui").ZodString;
            hash: import("@bpinternal/zui").ZodString;
            size: import("@bpinternal/zui").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
            file: import("@bpinternal/zui").ZodString;
            name: import("@bpinternal/zui").ZodString;
            hash: import("@bpinternal/zui").ZodString;
            size: import("@bpinternal/zui").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
    }, "strip", {
        processed: number;
        added: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[];
        updated: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[];
        deleted: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[];
        errors: string[];
    }, {
        processed?: number | undefined;
        added?: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[] | undefined;
        updated?: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[] | undefined;
        deleted?: {
            name: string;
            size: number;
            hash: string;
            file: string;
        }[] | undefined;
        errors?: string[] | undefined;
    }>, import("@bpinternal/zui").ZodObject<{
        urls: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
            loc: import("@bpinternal/zui").ZodString;
            lastmod: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
            changefreq: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
            priority: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
        }, "strip", {
            loc: string;
            lastmod?: string | undefined;
            changefreq?: string | undefined;
            priority?: string | undefined;
        }, {
            loc: string;
            lastmod?: string | undefined;
            changefreq?: string | undefined;
            priority?: string | undefined;
        }>, "many">>;
        queue: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
            url: import("@bpinternal/zui").ZodString;
            depth: import("@bpinternal/zui").ZodNumber;
        }, "strip", {
            url: string;
            depth: number;
        }, {
            url: string;
            depth: number;
        }>, "many">>;
    }, "strip", {
        urls: {
            loc: string;
            lastmod?: string | undefined;
            changefreq?: string | undefined;
            priority?: string | undefined;
        }[];
        queue: {
            url: string;
            depth: number;
        }[];
    }, {
        urls?: {
            loc: string;
            lastmod?: string | undefined;
            changefreq?: string | undefined;
            priority?: string | undefined;
        }[] | undefined;
        queue?: {
            url: string;
            depth: number;
        }[] | undefined;
    }>, Record<string, import("../../types").ZuiType>>;
    static fromWebsite(baseUrl: string, options?: WebsiteSourceOptions): WebsiteSource;
    static fromSitemap(sitemapUrl: string, options?: WebsiteSourceOptions): WebsiteSource;
    static fromLlmsTxt(llmsTxtUrl: string, options?: WebsiteSourceOptions): WebsiteSource;
    static fromUrls(urls: string[], options?: UrlsSourceOptions): WebsiteSource;
}
export {};
//# sourceMappingURL=source-website.d.ts.map