import { KosData } from '../util/observable-proxy-map';
import { IKosContainerIndex, IndexMapper } from './kos-container-index';
import { IKosBaseContainer, EvictionStrategy } from './kos-container-model';
import { IKosIdentifiable } from './types/model';
export interface IKosDataContainer<T extends IKosIdentifiable> extends IKosBaseContainer<T> {
    updateModel: (model: T) => void;
    getModel: (id: string) => T | undefined;
    getIndexByKey: (indexName: string, indexKey: string) => T[];
    getIndexKeys: (indexName: string) => string[];
}
interface ContainerOptions<T extends IKosIdentifiable> {
    sortKey?: keyof T;
    indexMap?: Record<string, keyof T | IndexMapper<T>>;
    /** SAFETY NET: Maximum capacity before eviction */
    maxCapacity?: number;
    /** Eviction strategy when maxCapacity is exceeded */
    evictionStrategy?: EvictionStrategy;
    /** Number of items to evict when capacity exceeded */
    evictionBatchSize?: number;
    /** Custom eviction filter for 'custom' strategy */
    customEvictionFilter?: (models: T[]) => T[];
}
export declare class KosDataContainer<T extends IKosIdentifiable> implements IKosDataContainer<T> {
    _data: Map<string, T>;
    private _sortKey?;
    private _revision;
    private _index;
    private _optionsMap;
    private _disposerMap;
    idx: KosData<Record<string, Record<string, T[]>>>;
    private _maxCapacity?;
    private _evictionStrategy;
    private _evictionBatchSize;
    private _insertionOrder;
    private _accessTimes?;
    private _customEvictionFilter?;
    constructor(options?: ContainerOptions<T>);
    init(): void;
    [Symbol.iterator](): ArrayIterator<T>;
    get index(): Map<string, IKosContainerIndex<T>>;
    get indexKeys(): Record<string, string[] | undefined>;
    get revision(): number;
    addAll(models: T[]): void;
    removeAll(ids: string[]): void;
    sortFn(a: any, b: any): number;
    get data(): T[];
    increment(): void;
    /**
     * Add a data object to the container (Zone 2: Workflow orchestration)
     *
     * @param model - The data object to add
     * @param defer - If true, skip incrementing revision (for batch operations)
     */
    addModel(model: T, defer?: boolean): void;
    /**
     * Ensure data is observable (Zone 3)
     * @private
     */
    private _ensureObservable;
    /**
     * Clean up existing disposer if present (Zone 3)
     * @private
     */
    private _cleanupExistingDisposer;
    /**
     * Persist data to container storage (Zone 3)
     * @private
     */
    private _persistData;
    /**
     * Track data metadata for capacity management (Zone 3)
     * @private
     */
    private _trackDataMetadata;
    /**
     * Enforce capacity limits and trigger eviction if needed (Zone 3)
     * @private
     */
    private _enforceCapacityLimits;
    /**
     * Configure MobX observers for data property changes (Zone 3)
     * @private
     */
    private _configureDataMonitoring;
    removeModel(id: string): void;
    updateModel(model: T): void;
    getModel(id: string): T | undefined;
    getIndexKeys(indexName: string): string[];
    getIndexByKey(indexName: string, indexKey: string): T[];
    /**
     * SAFETY NET: Evict data models when capacity is exceeded (Zone 2: Workflow orchestration)
     * Logs all evictions at WARNING level for debugging.
     * Note: Data models are not destroyed (no lifecycle), only removed from container.
     * @private
     */
    private _evictModels;
    /**
     * Log capacity exceeded warning for data container (Zone 3)
     * @private
     */
    private _logDataCapacityWarning;
    /**
     * Select data for eviction based on strategy (Zone 3)
     * @private
     */
    private _selectDataForEviction;
    /**
     * Select oldest data IDs for FIFO eviction (Zone 3)
     * @private
     */
    private _selectFifoData;
    /**
     * Select least recently used data IDs for LRU eviction (Zone 3)
     * @private
     */
    private _selectLruData;
    /**
     * Select data using custom filter for eviction (Zone 3)
     * @private
     */
    private _selectCustomData;
    /**
     * Remove evicted data items (Zone 3)
     * @private
     */
    private _removeEvictedData;
    /**
     * Log eviction completion for data container (Zone 3)
     * @private
     */
    private _logDataEvictionComplete;
    clear(): Promise<void>;
    filter<S extends any>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): T[];
    sort(compareFn?: ((a: any, b: any) => number) | undefined): T[];
    map<U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[];
    forEach(callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any): void;
    toJSON(): {
        indexes: Record<string, string[] | undefined>;
        data: {
            id: string;
        }[];
    };
}
export {};
//# sourceMappingURL=kos-data-container.d.ts.map