import { EdgeData, DataSource, DataAdapterConfig, GraphData, NodeId, NodeData, PaginationOptions, PaginatedResult, DataFilter, ContentData } from '@inferagraph/core/data'; type FileType = 'csv' | 'tsv' | 'markdown'; interface FileDataSourceConfigBase { /** Which file format to load */ type: FileType; /** File path (csv/tsv) or folder path (markdown) */ path: string; /** Host-supplied relationships */ edges: EdgeData[]; /** Column / frontmatter key for the node id (default 'id') */ idField?: string; } interface CsvLikeConfig extends FileDataSourceConfigBase { type: 'csv' | 'tsv'; /** First row contains column names (default true) */ hasHeader?: boolean; /** Required when hasHeader=false; length must equal first row's field count */ columns?: string[]; /** Host-chosen columns exposed via getContent for template injection */ contentFields?: string[]; } interface MarkdownConfig extends FileDataSourceConfigBase { type: 'markdown'; /** Required keys; each .md file must contain EXACTLY these keys (no more, no less) */ frontmatter: string[]; } type FileDataSourceConfig = CsvLikeConfig | MarkdownConfig; /** * DataSource that loads nodes from delimited files (CSV/TSV) or a folder * of Markdown files with frontmatter. Edges are host-supplied via config. * * After parsing, an internal {@link StaticDataAdapter} handles all graph * traversal/search/filter operations. `getContent` is handled directly: * * - markdown: returns the body of the source .md file with `contentType: 'markdown'` * - csv/tsv with `contentFields`: returns selected columns as `metadata` with * `content: ''` and `contentType: 'fields'` * - csv/tsv without `contentFields`: returns `undefined` */ declare class FileDataSource extends DataSource { readonly name = "file"; private readonly config; private readonly idField; private adapter; private connected; private contentByNodeId; private csvRowsById; constructor(config: FileDataSourceConfig); connect(): Promise; disconnect(): Promise; isConnected(): boolean; getInitialView(config?: DataAdapterConfig): Promise; getNode(id: NodeId): Promise; getNeighbors(nodeId: NodeId, depth?: number): Promise; findPath(fromId: NodeId, toId: NodeId): Promise; search(query: string, pagination?: PaginationOptions): Promise>; filter(filter: DataFilter, pagination?: PaginationOptions): Promise>; getContent(nodeId: NodeId): Promise; private loadCsvLike; private loadMarkdown; private requireAdapter; private ensureConnected; } /** * Factory for {@link FileDataSource}. Preferred entry point for hosts; the * class export remains available as an escape hatch for advanced subclassing. */ declare function fileDataSource(config: FileDataSourceConfig): FileDataSource; export { type CsvLikeConfig, FileDataSource, type FileDataSourceConfig, type FileDataSourceConfigBase, type FileType, type MarkdownConfig, fileDataSource };