artmapper
Version:
Spring Boot clone for Node.js with TypeScript/JavaScript - JPA-like ORM, Lombok decorators, dependency injection, and MySQL support
48 lines • 1.24 kB
TypeScript
import 'reflect-metadata';
import { Pool } from 'mysql2/promise';
export declare class Container {
private static instance;
private beans;
private beanTypes;
private config;
private pool;
private constructor();
static getInstance(): Container;
/**
* Set database pool for repositories
*/
setPool(pool: Pool): void;
/**
* Register a configuration value
*/
setConfig(key: string, value: any): void;
/**
* Get a configuration value
*/
getConfig(key: string): any;
/**
* Register a bean (component, service, controller, repository)
*/
registerBean<T>(target: new (...args: any[]) => T, instance?: T): void;
/**
* Get a bean by name or type
*/
getBean<T>(nameOrType: string | (new (...args: any[]) => any)): T;
/**
* Create an instance of a class with dependency injection
*/
private createInstance;
/**
* Scan and register all beans from a directory
*/
scanAndRegister(modulePath: string): Promise<void>;
/**
* Get all registered beans
*/
getAllBeans(): Map<string, any>;
/**
* Clear all beans
*/
clear(): void;
}
//# sourceMappingURL=Container.d.ts.map