/// <reference types="react" />
import { BlueBaseModuleRegistry, BlueBaseModuleRegistryInputItem, BlueBaseModuleRegistryItem } from './BlueBaseModuleRegistry';
import { ComponentStyles } from '../themes';
import { MaybeThunk, Thunk } from '../utils';
import { ItemCollection } from './Registry';
/**
 * Definition of the HOC
 */
export declare type ComponentRegistryHocItem = (...args: any[]) => React.ComponentType<any>;
export declare type ComponentRegistryHocItemWithArgs<T = any> = [Thunk<ComponentRegistryHocItem>, T];
/**
 * Source of this component. Contains information about who registered this component.
 */
export interface ComponentSource {
    type: 'plugin' | 'theme' | 'api' | 'custom';
    key: string;
}
interface ComponentRegistryItemExtras {
    hocs: Array<ComponentRegistryHocItem | ComponentRegistryHocItemWithArgs>;
    source: ComponentSource;
    styles: MaybeThunk<ComponentStyles>;
    isAsync: boolean;
}
export declare type ComponentRegistryItem = BlueBaseModuleRegistryItem<React.ComponentType<any>> & ComponentRegistryItemExtras;
export declare type ComponentRegistryInputItem = BlueBaseModuleRegistryInputItem<React.ComponentType<any>> & Partial<ComponentRegistryItemExtras>;
export declare type ComponentCollection = ItemCollection<ComponentRegistryInputItem>;
/**
 * 🎁 ComponentRegistry
 */
export declare class ComponentRegistry extends BlueBaseModuleRegistry<ComponentRegistryItem, ComponentRegistryInputItem> {
    /**
     * Resolves a Component. Wraps it in `hocs` and `styles`. Takes care of loading and error
     * states if required.
     * @param keys
     */
    resolve(...keys: string[]): React.ComponentType<any>;
    /**
     * Adds higher order component to the registered component
     * @param {string} key The name of the registered component to whom hocs are to added
     * @param {Array<ComponentRegistryHocItem>} hocs The HOCs to compose with the raw component.
     */
    addHocs(key: string, ...hocs: Array<ComponentRegistryHocItem | ComponentRegistryHocItemWithArgs>): void;
    /**
     * Set styles of a component.
     * @param key
     * @param styles
     */
    setStyles(key: string, styles: MaybeThunk<ComponentStyles>): void;
    /**
     * Get styles of a component
     * @param key
     */
    getStyles(key: string): MaybeThunk<ComponentStyles> | undefined;
    /**
     * 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: any): ComponentRegistryItem;
    /**
     * Typeguard to check a given object is an input value
     * @param value
     */
    protected isInputValue(value: any): value is ComponentRegistryInputItem['value'];
}
export {};
