import Bag from "../../api/Bag"; import { ApiLevelSwitch, ApiLevelSwitchFunction } from '../apiLevel/apiLevelUtils'; import Component from '../../api/component/Component'; import ConfigProvider from '../config/management/configProvider'; export declare type ComponentInfo = { apiLevels: number[] | null; static: boolean; }; export default abstract class ComponentPrepare { protected readonly cp: ConfigProvider; protected readonly bag: Bag; protected readonly componentType: string; protected readonly config: Record>; protected readonly components: Record>; protected readonly componentInits: (() => Promise | void)[]; protected readonly componentDefaultConfig: C | {}; protected constructor(cp: ConfigProvider, bag: Bag, type: string, config: Record>, componentDefaultConfig?: C); /** * Prepare all Components. */ prepare(): void; /** * It will return the Component instance. * If no Component with the API level is found, * it will throw an API level incompatible error, * and when the Component does not exist, it also throws an error. * @param identifier * @param apiLevel */ get(identifier: string, apiLevel: number): T; /** * Is used to create a specific: IncompatibleAPILevelError. */ protected abstract createIncompatibleAPILevelError(identifier: string, apiLevel: number): Error; /** * Is used to create a specific: ComponentNotExistsError. */ protected abstract createComponentNotExistsError(identifier: string): Error; /** * Returns a boolean that indicates if the Component exists. * @param identifier */ isExist(identifier: string): boolean; /** * Checks if the Component exists. * It will throw a error if the Component is not found. * @param identifier */ checkExist(identifier: string): void; /** * Prepare a component. */ protected abstract _prepare(identifier: string, definition: any): void; /** * Adds initialize of a component. * @param component */ protected addInit(component: Component): void; /** * Init all Components (after prepare) */ init(): Promise; getComponentType(): string; getComponentsInfo(): Record; }