import type { AnyIndexStore, AnyOrama, BM25Params, IIndex, SearchableType, SearchableValue, Tokenizer, TokenScore, WhereCondition } from '../types.js'; import type { InsertOptions } from '../methods/insert.js'; import { RadixNode } from '../trees/radix.js'; import { AVLTree } from '../trees/avl.js'; import { FlatTree } from '../trees/flat.js'; import { BKDTree } from '../trees/bkd.js'; import { BoolNode } from '../trees/bool.js'; import { DocumentID, InternalDocumentID, InternalDocumentIDStore } from './internal-document-id-store.js'; import { VectorType } from '../trees/vector.js'; export type FrequencyMap = { [property: string]: { [documentID: InternalDocumentID]: { [token: string]: number; } | undefined; }; }; export type TreeType = 'AVL' | 'Radix' | 'Bool' | 'Flat' | 'BKD'; export type TTree = { type: T; node: N; isArray: boolean; }; export type Tree = TTree<'Radix', RadixNode> | TTree<'AVL', AVLTree> | TTree<'Bool', BoolNode> | TTree<'Flat', FlatTree> | TTree<'BKD', BKDTree>; export interface Index extends AnyIndexStore { sharedInternalDocumentStore: InternalDocumentIDStore; indexes: Record; searchableProperties: string[]; searchablePropertiesWithTypes: Record; frequencies: FrequencyMap; tokenOccurrences: Record>; avgFieldLength: Record; fieldLengths: Record>; } export declare function insertDocumentScoreParameters(index: Index, prop: string, id: DocumentID, tokens: string[], docsCount: number): void; export declare function insertTokenScoreParameters(index: Index, prop: string, id: DocumentID, tokens: string[], token: string): void; export declare function removeDocumentScoreParameters(index: Index, prop: string, id: DocumentID, docsCount: number): void; export declare function removeTokenScoreParameters(index: Index, prop: string, token: string): void; export declare function create(orama: T, sharedInternalDocumentStore: T['internalDocumentIDStore'], schema: TSchema, index?: Index, prefix?: string): Index; export declare function insert(implementation: IIndex, index: Index, prop: string, id: DocumentID, internalId: InternalDocumentID, value: SearchableValue, schemaType: SearchableType, language: string | undefined, tokenizer: Tokenizer, docsCount: number, options?: InsertOptions): void; export declare function insertVector(index: AnyIndexStore, prop: string, value: number[] | VectorType, id: DocumentID, internalDocumentId: InternalDocumentID): void; export declare function remove(implementation: IIndex, index: Index, prop: string, id: DocumentID, internalId: InternalDocumentID, value: SearchableValue, schemaType: SearchableType, language: string | undefined, tokenizer: Tokenizer, docsCount: number): boolean; export declare function calculateResultScores(index: Index, prop: string, term: string, ids: InternalDocumentID[], docsCount: number, bm25Relevance: Required, resultsMap: Map, boostPerProperty: number, whereFiltersIDs: Set | undefined, keywordMatchesMap: Map>): void; export declare function search(index: Index, term: string, tokenizer: Tokenizer, language: string | undefined, propertiesToSearch: string[], exact: boolean, tolerance: number, boost: Record, relevance: Required, docsCount: number, whereFiltersIDs: Set | undefined, threshold?: number): TokenScore[]; export declare function searchByWhereClause(index: Index, tokenizer: Tokenizer, filters: Partial>, language: string | undefined): Set; export declare function getSearchableProperties(index: Index): string[]; export declare function getSearchablePropertiesWithTypes(index: Index): Record; export declare function load(sharedInternalDocumentStore: InternalDocumentIDStore, raw: R): Index; export declare function save(index: Index): R; export declare function createIndex(): IIndex; export declare function searchByGeoWhereClause(index: AnyIndexStore, filters: Partial>): TokenScore[] | null;