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("@botpress/sdk").ZodObject<{
        dsId: import("@botpress/sdk").ZodString;
        kbName: import("@botpress/sdk").ZodString;
        kbId: import("@botpress/sdk").ZodString;
        force: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodBoolean>>;
    }, "strip", {
        kbId: string;
        kbName: string;
        dsId: string;
        force: boolean;
    }, {
        kbId: string;
        kbName: string;
        dsId: string;
        force?: boolean | undefined;
    }>, import("@botpress/sdk").ZodObject<{
        processed: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodNumber>;
        added: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
            file: import("@botpress/sdk").ZodString;
            name: import("@botpress/sdk").ZodString;
            hash: import("@botpress/sdk").ZodString;
            size: import("@botpress/sdk").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        updated: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
            file: import("@botpress/sdk").ZodString;
            name: import("@botpress/sdk").ZodString;
            hash: import("@botpress/sdk").ZodString;
            size: import("@botpress/sdk").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        deleted: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
            file: import("@botpress/sdk").ZodString;
            name: import("@botpress/sdk").ZodString;
            hash: import("@botpress/sdk").ZodString;
            size: import("@botpress/sdk").ZodNumber;
        }, "strip", {
            name: string;
            size: number;
            hash: string;
            file: string;
        }, {
            name: string;
            size: number;
            hash: string;
            file: string;
        }>, "many">>;
        errors: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").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("@botpress/sdk").ZodObject<{
        urls: import("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
            loc: import("@botpress/sdk").ZodString;
            lastmod: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
            changefreq: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
            priority: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").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("@botpress/sdk").ZodDefault<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
            url: import("@botpress/sdk").ZodString;
            depth: import("@botpress/sdk").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