import { ServicesConfig } from "../main/config/definitions/main/servicesConfig"; import { AppConfig } from "../main/config/definitions/main/appConfig"; import { ServerConfig } from "../main/config/definitions/main/serverConfig"; import { ControllerClass } from "./Controller"; import { ControllerConfig } from "../main/config/definitions/parts/controllerConfig"; import { BagExtension } from 'zation-bag-extension'; import { ComponentClass } from './component/Component'; import Configurations, { ConfigurationDefinition } from '../main/config/definitions/main/configurations'; import { ConfigurationWrapper } from '../main/config/management/configurationWrapper'; export default class Config { private static tmpControllers; private static tmpReceivers; private static tmpDataboxes; private static tmpChannels; static readonly configurations: Configurations; /** * @description * Merge configs together. * If config has key conflicts the last one will be taken. * @example * merge(appConfig1,appConfig2,appConfig3); * @param configs */ static merge(...configs: ConfigurationDefinition[]): ConfigurationDefinition; /** * @description * Changes the configuration of a controller. * Can be used for setting the configuration in the app config. * @example * buildController(LoginController,{access: false}); * @param controller * The controller that should be updated. * @param config * The new configuration. * @param overrideControllerConfig * If the new configuration properties override the controller properties. * Default value is true. */ static buildController(controller: ControllerClass, config: ControllerConfig, overrideControllerConfig?: boolean): ControllerClass; /** * This method registers a new component (Controller, Databox or Channel) in the app config. * Watch out that you don't use an identifier that is already defined in the app config. * If you use this method in another file as the app config, * make sure that you import this file in app config. * Also, notice that if you want to register more components with the same identifier and different API levels, * make sure that all register methods with that identifier provided an API level. * @example * //without API level * Config.registerComponent('myDatabox',MyDatabox); * //with API level * Config.registerComponent('myController',MyControllerVersion1,1); * Config.registerComponent('myController',MyControllerVersion2,2); * @param identifier * @param componentClass * @param apiLevel */ static registerComponent(identifier: string, componentClass: ComponentClass, apiLevel?: number): void; /** * Registers a BagExtension. * @param extension */ static registerBagExtension(extension: BagExtension): void; /** * Function to create the app configuration for the server. * @param config * @param primaryAppConfig * Indicates if this is your primary app config. * Only to the primary config registered controllers, * receivers, channels and databoxes will be added. * If you have more app configs and you want to merge * them than only one of them should be the primary app config. */ static appConfig(config: ConfigurationDefinition, primaryAppConfig?: boolean): ConfigurationWrapper; private static configAdd; static serverConfig(config: ConfigurationDefinition): ConfigurationWrapper; static servicesConfig(config: ConfigurationDefinition): ConfigurationWrapper; private static createConfigurationWrapper; }