/** * Documentation coverage: which components under the configured globs have a * `[component]` preview, and which don't. * * "Documented" means some `[component]` block resolves to that file through * the real resolver — the same one the Explorer uses — so a compound family * counts correctly: `component={NavTree}` and `component={NavTree.Item}` * resolve to different `.svelte` files, and each is measured on its own. */ /** Where a component is documented. */ export interface CoverageSite { /** Project-relative .sdoc path */ file: string; /** Entity title */ entity: string; /** Preview tab label */ stage: string; /** The `component={…}` identifier as written */ component: string; } export interface CoverageResult { /** The globs coverage was measured against (project-relative). */ componentGlobs: string[]; counts: { components: number; documented: number; undocumented: number; }; /** Component files with no `[component]` pointing at them. */ undocumented: string[]; /** Component files with at least one preview, and where. */ documented: { component: string; sites: CoverageSite[]; }[]; /** Documented from more than one `.sdoc` file — usually a mistake. Several * previews of one component *within* one file is a supported pattern * (tabs), so that alone never lands here. */ multiplyDocumented: { component: string; files: string[]; }[]; /** `component={…}` references with no component source behind them: the * identifier traces to nothing, or it traces to a path that isn't on disk. * (`sdocs check` reports the missing import separately.) */ unresolved: CoverageSite[]; /** Documented components that lie outside the component globs — either the * globs are too narrow, or the component lives outside the project. */ documentedOutsideGlobs: string[]; } /** * Measure documentation coverage. * * @param docFiles absolute `.sdoc` paths * @param componentGlobs absolute globs locating component sources * @param cwd project root, for the relative paths in the result */ export declare function measureCoverage(docFiles: string[], componentGlobs: string[], cwd: string): Promise;