@orama/orama
Version:
A complete search engine and RAG pipeline in your browser, server, or edge network with support for full-text, vector, and hybrid search in less than 2kb.
22 lines (21 loc) • 936 B
TypeScript
import { AnySorterStore, ISorter, SortType } from '../types.js';
import { InternalDocumentID, InternalDocumentIDStore } from './internal-document-id-store.js';
interface PropertySort<K> {
docs: Map<InternalDocumentID, number>;
orderedDocs: [InternalDocumentID, K][];
orderedDocsToRemove: Map<InternalDocumentID, boolean>;
type: SortType;
}
export interface Sorter extends AnySorterStore {
sharedInternalDocumentStore: InternalDocumentIDStore;
isSorted: boolean;
language: string;
enabled: boolean;
sortableProperties: string[];
sortablePropertiesWithTypes: Record<string, SortType>;
sorts: Record<string, PropertySort<number | string | boolean>>;
}
export declare function load<R = unknown>(sharedInternalDocumentStore: InternalDocumentIDStore, raw: R): Sorter;
export declare function save<R = unknown>(sorter: Sorter): R;
export declare function createSorter(): ISorter<Sorter>;
export {};