import { BlueBaseModule, MaybeBlueBaseModule } from '../utils';
import { Registry } from './Registry';
/**
 * BlueBaseModule Registry Item
 */
export interface BlueBaseModuleRegistryItem<ValueType = any> {
    /** Item Key */
    key: string;
    /**
     * Registry Item Value.
     */
    value: BlueBaseModule<ValueType>;
    /**
     * Preload this value
     */
    preload: boolean;
    /** Additional Item Data */
    [key: string]: any;
}
/**
 * BlueBase Registry Item
 */
export declare type BlueBaseModuleRegistryInputItem<ValueType = any, Extras = {}> = {
    /**
     * Registry Item Value.
     */
    value: MaybeBlueBaseModule<ValueType>;
    /**
     * Preload this value
     */
    preload?: boolean;
    /** Additional Item Data */
    [key: string]: any;
} & Extras;
/**
 * A registry that has all items as promises. Used to make parts of the app capable of
 * supporting code splitting.
 */
export declare class BlueBaseModuleRegistry<ItemType extends BlueBaseModuleRegistryItem, ItemInputType extends BlueBaseModuleRegistryInputItem = BlueBaseModuleRegistryInputItem> extends Registry<ItemType, ItemInputType> {
    /**
     * The set() method adds or updates an element with a specified
     * key and item to the registry.
     * @param key
     * @param value
     */
    set(key: string, item: ItemType | ItemInputType): this;
    /**
     * Adds an Item or an Item value to the registry. If the item is a BlueBaseModule,
     * it is resolved first.
     *
     * @param item
     */
    register(item: ItemType | ItemType['value'] | ItemInputType | ItemInputType['value']): Promise<string>;
    register(key: string, item: ItemType | ItemType['value'] | ItemInputType | ItemInputType['value']): Promise<string>;
    /**
     * Preload all items that have preload property set to true
     */
    preloadAll(): Promise<any[]>;
    /**
     * Convert any input value to an item. This is where you transform inputs and add defualts
     * @param key
     * @param partial
     */
    protected createItem(key: string, partial: ItemType | ItemInputType): ItemType;
    /**
     * Typeguard to check a given object is a registry value
     * @param value
     */
    protected isValue(value: any): value is ItemType['value'];
    /**
     * Typeguard to check a given object is an input value
     * @param value
     */
    protected isInputValue(value: any): value is ItemInputType['value'];
}
