import { IKosIdentifiable } from './types/model';
import { IKosBaseContainer } from './kos-container-model';
import { IKosContainerIndex, IndexMapper } from './kos-container-index';
import { KosData } from '../util/observable-proxy-map';

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>>;
}
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[]>>>;
    constructor(options?: ContainerOptions<T>);
    init(): void;
    [Symbol.iterator](): IterableIterator<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;
    addModel(model: T, defer?: boolean): void;
    removeModel(id: string): void;
    updateModel(model: T): void;
    getModel(id: string): T | undefined;
    getIndexKeys(indexName: string): string[];
    getIndexByKey(indexName: string, indexKey: string): T[];
    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