/** * BrainyData V3 - Consistent API Design * * This is a proposed update to BrainyData with consistent method signatures. * All methods use object parameters for consistency and extensibility. */ import type { AddNounParams, AddVerbParams, SearchParams, SimilarityParams, RelatedParams, BatchNounsParams, BatchVerbsParams, GetNounsParams, GetVerbsParams, UpdateNounParams, MetadataParams, StatisticsParams, SearchResult, PaginatedResult, BatchResult, StatisticsResult } from './types/apiTypes.js'; /** * Proposed consistent API for BrainyData * All methods use object parameters */ export declare class BrainyDataV3 { constructor(config?: any); init(): Promise; close(): Promise; /** * Add a single noun * OLD: addNoun(data, type, metadata) * NEW: addNoun({ data, type, metadata }) */ addNoun(params: AddNounParams): Promise; /** * Add multiple nouns in batch * NEW METHOD for better performance */ addNouns(params: BatchNounsParams): Promise; /** * Get a single noun by ID * OLD: getNoun(id) * NEW: getNoun(id) - unchanged, simple enough */ getNoun(id: string): Promise; /** * Get multiple nouns with filtering * NEW METHOD for batch retrieval */ getNouns(params: GetNounsParams): Promise>; /** * Update a noun * OLD: updateNoun(id, data, metadata) - scattered * NEW: updateNoun({ id, data, metadata }) */ updateNoun(params: UpdateNounParams): Promise; /** * Delete a noun * OLD: deleteNoun(id) * NEW: deleteNoun(id) - unchanged, simple enough */ deleteNoun(id: string): Promise; /** * Add a single verb (relationship) * OLD: addVerb(source, target, type, metadata, weight) * NEW: addVerb({ source, target, type, weight, metadata }) */ addVerb(params: AddVerbParams): Promise; /** * Add multiple verbs in batch * NEW METHOD for better performance */ addVerbs(params: BatchVerbsParams): Promise; /** * Get a single verb by ID * OLD: getVerb(id) * NEW: getVerb(id) - unchanged, simple enough */ getVerb(id: string): Promise; /** * Get multiple verbs with filtering * OLD: getVerbsBySource(id), getVerbsByTarget(id), etc. * NEW: getVerbs({ source?, target?, type? }) */ getVerbs(params: GetVerbsParams): Promise>; /** * Delete a verb * OLD: deleteVerb(id) * NEW: deleteVerb(id) - unchanged, simple enough */ deleteVerb(id: string): Promise; /** * Unified search method * OLD: search(options), searchText(query, limit) * NEW: search({ query, limit, filter }) */ search(params: SearchParams): Promise; /** * Find similar items * OLD: findSimilar(id, limit) * NEW: findSimilar({ id, limit, filter }) */ findSimilar(params: SimilarityParams): Promise; /** * Find related items through graph traversal * OLD: getRelated(id, options) * NEW: findRelated({ id, depth, types }) */ findRelated(params: RelatedParams): Promise>; /** * Get metadata for an entity * OLD: getMetadata(id) * NEW: getMetadata(id) - unchanged, simple enough */ getMetadata(id: string): Promise; /** * Update metadata for an entity * OLD: updateMetadata(id, metadata) * NEW: updateMetadata({ id, metadata, merge }) */ updateMetadata(params: MetadataParams): Promise; /** * Get database statistics * OLD: getStatistics() * NEW: getStatistics({ detailed?, includeAugmentations? }) */ getStatistics(params?: StatisticsParams): Promise; get neural(): { /** * Calculate similarity between two items * Already good: neural.similar(a, b) */ similar: (a: any, b: any) => Promise; /** * Cluster items semantically * Already good: neural.clusters(items?) */ clusters: (items?: string[]) => Promise; /** * Find nearest neighbors * Already good: neural.neighbors(id, { limit }) */ neighbors: (id: string, options?: any) => Promise; /** * Build semantic hierarchy * Already good: neural.hierarchy(id) */ hierarchy: (id: string) => Promise; /** * Detect outliers * Already good: neural.outliers() */ outliers: () => Promise; /** * Get visualization data * Already good: neural.visualize() */ visualize: () => Promise; }; get augmentations(): { add: (aug: any) => void; remove: (name: string) => void; get: (name: string) => null; execute: (op: string, params: any) => Promise; getTypes: () => never[]; }; } /** * Migration wrapper for backward compatibility * This allows existing code to work with the new API */ export declare class BrainyDataMigrationWrapper extends BrainyDataV3 { /** * OLD SIGNATURE: addNoun(data, type, metadata) * Wraps to NEW: addNoun({ data, type, metadata }) */ addNoun(dataOrParams: any | AddNounParams, type?: string, metadata?: any): Promise; /** * OLD SIGNATURE: addVerb(source, target, type, metadata, weight) * Wraps to NEW: addVerb({ source, target, type, weight, metadata }) */ addVerb(sourceOrParams: string | AddVerbParams, target?: string, type?: string, metadata?: any, weight?: number): Promise; /** * OLD SIGNATURE: searchText(query, limit) * Wraps to NEW: search({ query, limit }) */ searchText(query: string, limit?: number): Promise; /** * OLD SIGNATURE: findSimilar(id, limit) * Wraps to NEW: findSimilar({ id, limit }) */ findSimilar(idOrParams: string | SimilarityParams, limit?: number): Promise; /** * OLD METHODS: getVerbsBySource, getVerbsByTarget * Wraps to NEW: getVerbs({ source }) or getVerbs({ target }) */ getVerbsBySource(sourceId: string): Promise; getVerbsByTarget(targetId: string): Promise; }