import { IStorageAdapter } from './IStorageAdapter'; import { IList } from './IList'; import { IndexDef, SerializedIndexDef } from '../types/IndexDef'; import { IndexStored } from '../types/IndexStored'; import { Paths } from '../types/Paths'; import { Item } from '../types/Item'; import { IdGeneratorFunction } from '../types/IdGeneratorFunction'; import { ICollectionConfig, ISerializedCollectionConfig } from './ICollectionConfig'; import { CronJob } from 'cron'; import { Dictionary } from '../types/Dictionary'; import { BPlusTree, ValueType } from 'b-pl-tree'; import { TraverseCondition } from '../types/TraverseCondition'; import { StoredIList } from '../types/StoredIList'; import { IDataCollection } from './IDataCollection'; import { ProcessInsert } from './ProcessInsert'; import { ProcessUpdates } from './ProcessUpdates'; import { ProcessRemoves } from './ProcessRemoves'; import { ProcessEnsure } from './ProcessEnsure'; import { ProcessRebuild } from './ProcessRebuild'; import { ZodError, ZodType } from 'zod'; export declare const ttl_key = "__ttltime"; export default class Collection implements IDataCollection { get config(): ISerializedCollectionConfig; static genCache: Dictionary>; root: string; cronJob?: CronJob; createIndex(name: string, config: IndexDef): Promise; listIndexes(name: string): any; dropIndex(name: string): void; storage: IStorageAdapter; ttl?: number; rotate?: string; name: string; id: string; auto?: boolean; audit: boolean; validation: ZodType; validator(item: T): { success: true; data: T; } | { success: false; errors: ZodError; }; indexes: { [index: string]: BPlusTree; }; list: IList; inserts: Array>; updates: Array>; removes: Array>; ensures: Array; rebuilds: Array; indexDefs: Dictionary>; private constructor(); static create(config?: ICollectionConfig): Collection; static fromList(array: Array, id: string, root: string): Promise>; reset(): Promise; load(name?: string): Promise; store(): { config: any; list: StoredIList; indexes: { [key: string]: unknown; }; indexDefs: Dictionary>; }; persist(name?: string): Promise; push(item: T): Promise; create(item: T): Promise; save(res: T): Promise; first(): Promise; last(): Promise; lowest(key: Paths): Promise; greatest(key: Paths): Promise; oldest(): Promise; latest(): Promise; findById(id: ValueType): Promise; findBy(key: Paths, id: ValueType): Promise>; findFirstBy(key: Paths, id: ValueType): Promise; findLastBy(key: Paths, id: ValueType): Promise; find(condition: TraverseCondition): Promise>; findFirst(condition: TraverseCondition): Promise; findLast(condition: TraverseCondition): Promise; update(condition: TraverseCondition, update: Partial, merge?: boolean): Promise>; updateFirst(condition: TraverseCondition, update: Partial, merge?: boolean): Promise; updateLast(condition: TraverseCondition, update: Partial, merge?: boolean): Promise; updateWithId(id: ValueType, update: Partial, merge?: boolean): Promise; removeWithId(id: ValueType): Promise; remove(condition: TraverseCondition): Promise>; removeFirst(condition: TraverseCondition): Promise; removeLast(condition: TraverseCondition): Promise; } export declare function serializeIndex(res: IndexDef): SerializedIndexDef; export declare function deserializeIndex(res: SerializedIndexDef): IndexDef;