// signature-extractor.ts — Extract real exports from source files (SPEC-696)
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
const EXPORT_RE = /^export (?:async function|function|class|const|type|interface)\s+\w[^{;]*/gm;
const INTERFACE_RE = /^export interface\s+\w+\s*\{[^}]*\}/gms;
export async function extractSignatures(projectPath, relPath) {
    try {
        const absPath = join(projectPath, relPath);
        const content = await readFile(absPath, 'utf8');
        const exports = [...content.matchAll(EXPORT_RE)].map((m) => m[0].trim()).slice(0, 10);
        const interfaces = [...content.matchAll(INTERFACE_RE)].map((m) => m[0].trim()).slice(0, 5);
        return { relPath, exports, interfaces };
    }
    catch {
        return { relPath, exports: [], interfaces: [] };
    }
}
//# sourceMappingURL=signature-extractor.js.map