Skip to content

Commit

Permalink
Add Application Configurator interface (incomplete)
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Sep 29, 2024
1 parent d16a4d1 commit 069ab6a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions packages/contracts/src/core/configuration/Configurator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import {
ServiceProvider,
ServiceProviderConstructor,
} from "@aedart/contracts/support/services";
import BootstrapperConstructor from "../BootstrapperConstructor";
import Application from '../Application';

/**
* TODO: Incomplete...
*
* Application Configurator
*
* Responsible for setup and configuration of a given application,
* e.g. registration of "core" bindings, bootstrappers, service providers, ...etc.
*/
export default interface Configurator
{
/**
* TODO: Move to application interface!
*
* Set the "core" bootstrappers the application must use
*
* @param {BootstrapperConstructor[]} bootstrappers
*
* @returns {this}
*/
withBootstrappers(bootstrappers: BootstrapperConstructor[]): this;

/**
* TODO: Move to application interface!
*
* Set the "core" service providers to be registered by the application
*
* @param {(ServiceProvider | ServiceProviderConstructor)[]} providers
*
* @returns {this}
*/
withServiceProviders(providers: (ServiceProvider | ServiceProviderConstructor)[]): this;

/**
* TODO: This method should be the only method in this interface...
*
* Applies setup and configuration of the application and returns it
*
* @returns {Application}
*/
apply(): Application;
}

0 comments on commit 069ab6a

Please sign in to comment.