Library source analysis - unified entry point and shared types.
Provides a single function for analyzing TypeScript and Svelte source files,
dispatching to the appropriate domain-specific analyzer.
This module also exports shared types used by both analyzers:
- DeclarationAnalysis - A declaration with its nodocs flag
- ReExportInfo - Information about a same-name re-export
- ModuleAnalysis - Result of analyzing a module (unified structure)
@example
```ts
import {library_analyze_module} from '@fuzdev/fuz_ui/library_analysis.js';
import {ts_create_program} from '@fuzdev/fuz_ui/ts_helpers.js';
import {module_create_source_options} from '@fuzdev/fuz_ui/module_helpers.js';
import {AnalysisContext} from '@fuzdev/fuz_ui/analysis_context.js';
const {program} = ts_create_program({root: './my-project'});
const ctx = new AnalysisContext();
const options = module_create_source_options('/my-project');
const result = library_analyze_module(
{id: '/my-project/src/lib/file.ts', content: '...'},
program,
options,
ctx,
);
if (result) {
// Filter out @nodocs declarations
const declarations = result.declarations
.filter(d => !d.nodocs)
.map(d => d.declaration);
console.log('Declarations:', declarations);
}
```
@see ts_helpers.ts for TypeScript-specific analysis
@see svelte_helpers.ts for Svelte component analysis
@see module_helpers.ts for path utilities and SourceFileInfo