import { FileChangeEvent, PackageInfo } from '../types.js'; import '@bfra.me/es/result'; import 'zod'; interface DocWatcherOptions { readonly rootDir?: string; readonly debounceMs?: number; readonly additionalIgnore?: readonly string[]; readonly usePolling?: boolean; } type DocChangeHandler = (events: readonly FileChangeEvent[]) => void | Promise; interface DocFileWatcher { readonly start: () => Promise; readonly close: () => Promise; readonly onChanges: (handler: DocChangeHandler) => () => void; readonly getWatchedPaths: () => readonly string[]; } declare function createDocWatcher(options?: DocWatcherOptions): DocFileWatcher; type FileCategory = 'readme' | 'source' | 'package-json' | 'unknown'; declare function categorizeFile(filePath: string): FileCategory; declare function groupChangesByPackage(events: readonly FileChangeEvent[]): Map; declare function filterDocumentationChanges(events: readonly FileChangeEvent[]): FileChangeEvent[]; interface DocChangeDetectorOptions { readonly algorithm?: 'sha256' | 'md5'; } interface PackageChangeAnalysis { readonly packageName: string; readonly needsRegeneration: boolean; readonly changedCategories: readonly FileCategory[]; readonly changedFiles: readonly string[]; } interface DocChangeDetector { readonly hasChanged: (filePath: string) => Promise; readonly record: (filePath: string) => Promise; readonly recordPackage: (pkg: PackageInfo, files: readonly string[]) => Promise; readonly clear: (filePath: string) => void; readonly clearAll: () => void; readonly analyzeChanges: (events: readonly FileChangeEvent[]) => Promise; } declare function createDocChangeDetector(options?: DocChangeDetectorOptions): DocChangeDetector; type RegenerationScope = 'full' | 'api-only' | 'readme-only' | 'metadata-only' | 'none'; declare function determineRegenerationScope(changedCategories: readonly FileCategory[]): RegenerationScope; declare function hasAnyFileChanged(detector: DocChangeDetector, files: readonly string[]): Promise; interface DocDebouncerOptions { readonly debounceMs?: number; readonly maxWaitMs?: number; } type BatchChangeHandler = (events: readonly FileChangeEvent[]) => void | Promise; interface DocDebouncer { readonly add: (event: FileChangeEvent) => void; readonly addAll: (events: readonly FileChangeEvent[]) => void; readonly flush: () => void; readonly cancel: () => void; readonly getPendingCount: () => number; } declare function createDocDebouncer(handler: BatchChangeHandler, options?: DocDebouncerOptions): DocDebouncer; declare function deduplicateEvents(events: readonly FileChangeEvent[]): FileChangeEvent[]; declare function consolidateEvents(events: readonly FileChangeEvent[]): FileChangeEvent[]; export { type BatchChangeHandler, type DocChangeDetector, type DocChangeDetectorOptions, type DocChangeHandler, type DocDebouncer, type DocDebouncerOptions, type DocFileWatcher, type DocWatcherOptions, type FileCategory, type PackageChangeAnalysis, type RegenerationScope, categorizeFile, consolidateEvents, createDocChangeDetector, createDocDebouncer, createDocWatcher, deduplicateEvents, determineRegenerationScope, filterDocumentationChanges, groupChangesByPackage, hasAnyFileChanged };