/** * TermImporter — JSON/YAML/CSV 批量导入 + 导入报告 * FR-H05 * * 纯 TypeScript 实现,不引入外部 YAML/CSV 库。 */ import type { KnowledgeSource } from '../types/index.js'; import type { DictionaryService } from './dictionary-service.js'; import type { ImportReport } from './term-types.js'; export interface TermImporterOptions { dictionaryService: DictionaryService; } export declare class TermImporter { private readonly service; constructor(options: TermImporterOptions); /** 从文本内容批量导入术语 */ importFromContent(content: string, format: 'json' | 'yaml' | 'csv', source: KnowledgeSource): Promise; /** 从治理文件中解析术语定义并导入 */ importFromGovernanceContent(content: string, source: KnowledgeSource, defaultScope?: string[]): Promise; /** 导出术语为指定格式 (P1-2: JSON/YAML/CSV 三格式) */ exportTo(format: 'json' | 'yaml' | 'csv', scope?: string): Promise; /** 导出术语为 JSON 字符串 (向后兼容) */ exportToJson(scope?: string): Promise; /** * 从治理文件(markdown)中解析术语定义并导入 * FR-H05 AC2:作为文档知识提取(FR-A02)的一种特化策略 * * 支持的 markdown 格式: * ## 术语名 * 定义文本 * - 约束: xxx * - 别名: a, b * - 正例: xxx * - 负例: xxx * - 适用域: scope1, scope2 */ importFromGovernanceDoc(content: string, source: KnowledgeSource): Promise; private parseGovernanceDoc; private parse; private parseJson; /** 简易 YAML 解析器 — 支持列表项格式 */ private parseYaml; private parseYamlKV; /** CSV 解析器 — 首行为表头 */ private parseCsv; private parseCsvLine; private parseGovernanceTerms; private assignGovernanceField; private toYaml; private toCsv; private csvEscape; private importItems; } //# sourceMappingURL=term-importer.d.ts.map