/// <reference types="jquery" />
import { AjaxCall, CodeType, CodeTypeCacheEventMap, DoEntity, EventEmitter, ObjectModel, ObjectOrModel, UiNotificationEvent } from '../index';
/**
 * Cache for CodeTypes grouped by CodeType id.
 */
export declare class CodeTypeCache extends EventEmitter implements ObjectModel<CodeTypeCache> {
    self: CodeTypeCache;
    eventMap: CodeTypeCacheEventMap;
    id: string;
    /**
     * Map of CodeType id to CodeType instance. Do not access directly. Instead, use {@link get}.
     */
    registry: Map<any, CodeType<any, any, any>>;
    /**
     * URL to get CodeType data from
     */
    url: string;
    protected _call: AjaxCall;
    protected _reloadTimeoutId: number;
    protected _idsToUpdate: string[];
    constructor();
    /**
     * Loads code types from the main system using the url configuration of that {@link System}.
     */
    bootstrapSystem(): JQuery.Promise<void>;
    /**
     * Initializes the code type map with the result of the given REST url.
     */
    bootstrap(url: string): JQuery.Promise<void>;
    /**
     * Loads the CodeTypes from the backend. The URL provided in {@link bootstrap} is used.
     * @param codeTypeIds Optional list of {@link CodeType.id} to load. If not specified, all are loaded.
     * @returns The newly loaded {@link CodeType} instances.
     */
    loadCodeTypes(codeTypeIds?: string[]): JQuery.Promise<CodeType<any, any, any>[]>;
    protected _handleCodesResponse(data: any): CodeType<any, any, any>[];
    protected _onCodeTypeUpdateNotify(event: UiNotificationEvent): void;
    protected _scheduleCodeTypeUpdate(idsToUpdate: string[], delay: number): void;
    protected _triggerCodeTypeChange(codeType: CodeType<any, any, any>): void;
    protected _triggerCodeTypeRemove(id: any): void;
    /**
     * Adds the given CodeType models to the registry. Existing entries with the same ids are overwritten.
     * @returns The registered CodeType instances.
     */
    add(codeTypes: ObjectOrModel<CodeType<any, any, any>> | ObjectOrModel<CodeType<any, any, any>>[]): CodeType<any, any, any>[];
    /**
     * Removes the given CodeTypes from the registry.
     *
     * @param codeTypes code types or code type ids to remove.
     */
    remove(codeTypes: string | CodeType<any, any, any> | (string | CodeType<any, any, any>)[]): void;
    /**
     * Gets the CodeType with given id or Class.
     * @param codeTypeIdOrClassRef The CodeType id or Class
     * @returns The CodeType instance or undefined if not found.
     */
    get<T extends CodeType<any>>(codeTypeIdOrClassRef: string | (new () => T)): T;
}
export interface CodeTypeUpdateMessageDo extends DoEntity {
    codeTypes?: ObjectOrModel<CodeType<any, any, any>>[];
    codeTypeIds?: string[];
    reloadDelayWindow?: number;
}
export interface CodeTypeRequest extends DoEntity {
    codeTypeIds?: string[];
}
export declare const codes: CodeTypeCache;
//# sourceMappingURL=CodeTypeCache.d.ts.map