@elsikora/cladi
Version:
ClaDI is a library for creating and managing classes in TypeScript.
57 lines • 2.76 kB
TypeScript
import type { IContainer, IFactory, ILogger, IRegistry } from '../../domain/interface/index';
import type { IBaseContainerOptions, IBaseFactoryOptions, IBaseRegistryOptions, IConsoleLoggerOptions, ICoreFactoryOptions } from '../interface/index';
/**
* Factory for creating infrastructure components.
* Provides methods to create instances of Registry, Factory, Container, and Logger.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/factory} for more details on factories.
*/
export declare class CoreFactory {
private static instance;
private readonly LOGGER;
/**
* Creates a new infrastructure factory.
* @param {ICoreFactoryOptions} options - The options to use for the factory.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/factory}
*/
constructor(options: ICoreFactoryOptions);
/**
* Gets the singleton instance of the InfrastructureFactory.
* @param {ICoreFactoryOptions} options - The options to use for the factory.
* @returns {CoreFactory} The singleton instance.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/factory}
*/
static getInstance(options: ICoreFactoryOptions): CoreFactory;
/**
* Creates a new container instance.
* @param {IBaseContainerOptions} options - The options to use for the container.
* @returns {IContainer} A new container instance.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/container}
*/
createContainer(options: IBaseContainerOptions): IContainer;
/**
* Creates a new factory instance.
* @template T The type of items created by the factory.
* @param {IBaseFactoryOptions<T>} options Factory creation options.
* @returns {IFactory<T>} A new factory instance.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/factory}
*/
createFactory<T>(options: IBaseFactoryOptions<T>): IFactory<T>;
/**
* Creates a new logger instance.
* @param {IConsoleLoggerOptions} options - The options to use for the logger.
* @returns {ILogger} A new logger instance.
* @see {@link https://elsikora.com/docs/cladi/services/logging}
*/
createLogger(options: IConsoleLoggerOptions): ILogger;
/**
* Creates a new registry instance.
* @template T The type of items stored in the registry (must have a name property).
* @param {IBaseRegistryOptions} options - The options to use for the registry.
* @returns {IRegistry<T>} A new registry instance.
* @see {@link https://elsikora.com/docs/cladi/core-concepts/registry}
*/
createRegistry<T extends {
getName(): string;
}>(options: IBaseRegistryOptions): IRegistry<T>;
}
//# sourceMappingURL=core.factory.d.ts.map