import { SiteConfig, UserConfig } from 'vitepress';

type Any = any;
type VitePlugin = NonNullable<NonNullable<UserConfig['vite']>['plugins']>[number];
type VPConfig = SiteConfig;
type LlmsPageData = {
    path: string;
    url: string;
    title: string;
    llmUrl: string;
    frontmatter: Record<string, Any>;
    content: string;
};
type IndexTOC = boolean | 'only-llms' | 'only-llms-links' | 'only-web' | 'only-web-links';
type LlmsConfig = {
    /**
     * Hostname
     *
     * @example 'https://example.org'
     */
    hostname?: string;
    /**
     * An array of glob patterns to ignore.
     *
     * @example ["**\/guide/api.md"]
     */
    ignore?: string[];
    /**
     * Build `llms.txt` file
     *
     * @default true
     */
    llmsFile?: boolean | {
        /**
         * Add index table of content in index 'llms.txt' file.
         * - _'only-llms'_ - Only title with LLMs links
         * - _'only-web'_ - Only title with web links
         * - _'only-llms-links'_ - Only LLMs links
         * - _'only-web-links'_ - Only web links
         * - _true_ - both
         * - _false_ - none
         */
        indexTOC: IndexTOC;
    };
    /**
     * Build `llms-full.txt` file
     *
     * @default true
     */
    llmsFullFile?: boolean;
    /**
     * Build `.md` file for each route
     *
     * @default true
     */
    mdFiles?: boolean;
    /**
     * Callback for transform each page
     */
    transform?: (data: {
        page: LlmsPageData;
        pages: LlmsPageData[];
        vpConfig?: VPConfig;
        utils: {
            getIndexTOC: (type: IndexTOC) => string;
            removeFrontmatter: (content: string) => string;
        };
    }) => Promise<LlmsPageData> | LlmsPageData;
};

export type { LlmsConfig as L, VitePlugin as V, LlmsPageData as a };
