import { type Entity, type CursorPaginationOptions, type CursorPaginatedResult } from './pagination.js'; export type { Entity }; export type InsertInput = Omit & { id?: string; }; export type FilterFn = (item: T) => boolean; export type SortFn = (a: T, b: T) => number; export interface CollectionHooks { onInsert?: (item: T) => void; onUpdate?: (item: T) => void; onDelete?: (item: T) => void; } export declare class Collection { private prefix; private indexFields; private items; private indexes; private hooks; readonly fieldNames: string[]; constructor(prefix: string, indexFields?: (keyof T)[]); private addToIndex; private removeFromIndex; insert(data: InsertInput): T; get(id: string): T | undefined; findBy(field: keyof T, value: string | number): T[]; findOneBy(field: keyof T, value: string | number): T | undefined; update(id: string, data: Partial): T | undefined; delete(id: string): boolean; deleteBy(field: keyof T, value: string | number): number; setHooks(hooks: CollectionHooks): void; all(): T[]; list(options?: CursorPaginationOptions): CursorPaginatedResult; count(filter?: FilterFn): number; clear(): void; } export declare class Store { private collections; private _data; collection(name: string, prefix: string, indexFields?: (keyof T)[]): Collection; getData(key: string): V | undefined; setData(key: string, value: V): void; deleteDataByPrefix(prefix: string): number; reset(): void; }