import type { MDXFile, PageMeta, SectionConfig, FontConfig, AnalyticsConfig, NormalizedOpenApiSpec } from "./lib/types.js"; import type { OperationDescriptor } from "./lib/openapi-types.js"; import { type GeneratedPageCommit } from "./generator/generated-page-publisher.js"; export declare class MDXToNextJSGenerator { private watchDir; private outputDir; private rootDir; private doccupineConfigFile; private configFiles; private fontConfigFile; private analyticsConfigFile; private analyticsConfig; private sectionsConfig; /** Guards against recursive reprocessing when maybeUpdateSections() triggers processAllMDXFiles() */ private isReprocessing; /** OpenAPI specs (build config) that drive the generated API reference. */ private openApiSpecs; private apiBaseSlug; private apiRegistry; private artifacts; private sourceFs; private appScaffolder; private apiReferenceGenerator; private generatedPagePublisher; private generatedRouteManager; private mdxReconciliationCoordinator; private openApiRefreshCoordinator; private sectionIndexGenerator; private projectConfigRepository; private publicAssetManager; private iconAssetManager; private watchCoordinator; constructor(watchDir: string, outputDir: string, openApiSpecs?: NormalizedOpenApiSpec[], rootDir?: string); private outputPath; private readMdxSourceFile; private writeStarterFilesIfEmpty; private refreshInitialDoccupineConfig; init(): Promise; createNextJSStructure(): Promise; createStartingDocs(): Promise; copyCustomConfigFiles(): Promise; copyFontConfig(): Promise; loadFontConfig(): Promise; loadAnalyticsConfig(): Promise; copyAnalyticsConfig(): Promise; loadSectionsConfig(): Promise; discoverSectionsFromFrontmatter(): Promise; resolveSections(): Promise; /** * Promotes the generated OpenAPI endpoints into a dedicated "API Reference" * section so they get their own top-level nav, separate from hand-written * docs. When the site had no sections, a root "Documentation" section is added * for the existing pages so both appear in the section switcher. */ private withApiReferenceSection; private reloadSections; private maybeUpdateSections; private reconcileMdxSources; private determineSectionForFile; handleConfigFileChange(filePath: string): Promise; handleConfigFileDelete(filePath: string): Promise; handleFontConfigChange(): Promise; handleFontConfigDelete(): Promise; handleAnalyticsConfigChange(): Promise; handleAnalyticsConfigDelete(): Promise; copyPublicFiles(): Promise; syncIconFiles(): Promise; handlePublicFileChange(filePath: string): Promise; handlePublicFileDelete(filePath: string): Promise; startWatching(): Promise; private buildRealPagesMeta; private buildAllPagesMeta; private readAggregateMdxSource; private removeOwnedRoute; private refreshSiteAggregates; handleFileChange(action: string, filePath: string): Promise; handleFileDelete(filePath: string): Promise; processAllMDXFiles(): Promise; getAllMDXFiles(): Promise; generateRootLayout(): Promise; generateSiteLayout(pages?: PageMeta[]): Promise; generateSectionIndexPages(pages?: PageMeta[], declaredSlugs?: Set): Promise; private writeSectionIndexRedirect; generatePageFromMDX(mdxFile: MDXFile, options?: { apiOperation?: OperationDescriptor; }): Promise; /** Parses the configured OpenAPI spec(s) into the shared registry. */ private loadOpenApiRegistry; /** * Generates one page per OpenAPI operation, (re)writes the request-execution * allowlist consumed by the playground proxy + component, and removes endpoint * pages that no longer exist in the spec. Safe to call when there are no specs * - it still emits an empty allowlist and prunes any previously generated * pages (e.g. after the `openapi` config is removed). */ private writeApiPages; /** Writes the request-execution allowlist (overwrites the shipped stub). */ private writeApiAllowlist; /** Removes endpoint page directories that are no longer in the spec. */ private cleanupStaleApiPages; /** * (Re)points the spec-file watcher at the currently configured spec paths. * Called at startup and whenever doccupine.json changes the `openapi` set, * so specs added mid-session are watched without a restart. */ private syncOpenApiSpecWatcher; /** Reparses the spec(s) and regenerates the API reference on a watch event. */ handleOpenApiChange(): Promise; /** * Applies `openapi` edits in doccupine.json without a restart: reloads the * registry, regenerates or prunes the endpoint pages and allowlist, * refreshes nav/sitemap/llms, and re-points the spec-file watcher. Other * fields (watchDir, outputDir, port) cannot be hot-applied, so a change * there only logs a restart hint. Invalid or missing JSON (e.g. a * half-written editor save) keeps the current configuration. */ handleDoccupineConfigChange(): Promise; updatePagesIndex(pages?: readonly PageMeta[]): Promise; updateSectionIndex(sectionSlug: string, frontmatter: Record, mdxContent: string, sourcePath?: string): Promise; updateRootLayout(pages?: PageMeta[]): Promise; loadSiteUrl(): Promise; updateSitemap(pages?: PageMeta[]): Promise; updateRobots(): Promise; updateLlmsFiles(pages?: PageMeta[]): Promise; stop(): Promise; }