import { BlueBaseModule, MaybeBlueBaseModule } from '../utils'; import { ItemSource, Registry } from './Registry'; /** * BlueBaseModule Registry Item */ export interface BlueBaseModuleRegistryItem { /** Additional Item Data */ [key: string]: any; /** Item Key */ key: string; /** * Registry Item Value. */ value: BlueBaseModule; /** The source of this item */ source: ItemSource; /** * Preload this value */ preload: boolean; } /** * BlueBase Registry Item */ export type BlueBaseModuleRegistryInputItem = { /** Additional Item Data */ [key: string]: any; /** * Registry Item Value. */ value: MaybeBlueBaseModule; /** * Preload this value */ preload?: boolean; } & 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 extends Registry { /** * 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; register(key: string, item: ItemType | ItemType['value'] | ItemInputType | ItemInputType['value']): Promise; /** * Preload all items that have preload property set to true */ preloadAll(): Promise; /** * 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']; }