import type { APIData, EnrichedComponentInfo, GeneratedOutput } from '../../types'; import type { LLMOutputConfig } from '../../types/configuration'; /** * Minimal LLM documentation generator * - Focuses on API quick reference; optionally includes variants and examples * - Respects SvelteDocsConfig.llm (include, priority, excludeTypes, maxSections) * - Supports file or directory output depending on config.llm.outputPath */ export declare class LLMDocumentationGenerator { private config; private docsParser; /** * Per-run memo for parsed docs.svelte configs, keyed by component name. * Lets the write loop, the `shouldEmit` gate, and the index loop share one * parse per component instead of re-reading docs.svelte three times. Cleared * at the top of every `generate()` so a reused instance never serves stale * config across targets. */ private docsConfigCache; constructor(config: LLMOutputConfig); generate(enrichedComponents: EnrichedComponentInfo[], apiData: APIData): Promise; private generateSingleFileContent; private generateComponentContent; private renderOverviewMarkdown; private renderApiMarkdown; private renderVariantsMarkdown; /** * A type definition rendering longer than this many lines is replaced by a * one-line summary (member count + source path) — llm.txt is the * token-efficiency surface; a 200-line locale-key tree is noise there. The * docs page (TypesReference) still renders the full definition, collapsed * behind its row expansion, and api.ts keeps the complete data. */ private static readonly MAX_TYPE_DEFINITION_LINES; /** * Render the component's supporting type definitions (category 'helper' — * business types like `GuideTour` or `MenuItemType`). Props interfaces and * variant aliases are excluded: the Api and Variants sections already carry * that information. Oversized definitions collapse to an honest summary * instead of a truncated body. Returns null when there is nothing worth * printing. */ private renderTypesMarkdown; private renderExamplesMarkdown; /** * Whether a component gets its own `llm.txt` — and therefore an index link. * Both the per-component write loop and the `llms.txt` index loop gate on * this, so the index can never reference a file the write loop skipped * (missing API data, or `llm.include === false` in docs.svelte). */ private shouldEmit; /** * Read (and memoise) a component's docs.svelte config. * * `parseDocsFile` reports a docs.svelte that exists but cannot be read — an * unreadable file, or a `docsConfig` that is not a static object literal * (`SvelteDocsParser` gives `file:line:column`). Continuing with * `mergeWithSvelteDocsDefaults({})` there would silently discard the settings * the author actually wrote: `llm.include: false` would flip back to `true` * and emit an llm.txt the component opted out of. That is the same silent * fallback the AST parser replaced `eval` to remove, one station later — so a * *present but broken* config fails the generation. * * An *absent* docs.svelte is not an error: `parseDocsFile` returns no errors * and the component takes the documented defaults (a constant default, not a * guess). Warnings are advisory and only logged. */ private loadDocsConfig; private resolveDocsFilePath; private shouldIncludeInLLM; private orderAndLimitSections; private calculateTotalSize; private generateLlmsTxt; /** * Render the static-root `llms.txt` aggregator: a fixed index linking * `llms-full.txt` plus the four per-scope manifests (blocks/docs/table/auth). * Pure string assembly — scope links may briefly dangle until every target * has run, which is the designed single-target behaviour, not an error. */ private generateGlobalLlmsTxt; private buildComponentJson; private renderContextHeader; private renderPatternsSection; private extractSlotInfo; private capitalize; } //# sourceMappingURL=LLMDocumentationGenerator.d.ts.map