UNPKG

lakutata

Version:

An IoC-based universal application framework.

984 lines (958 loc) 32.1 kB
import { D as DTO } from './TypeDef.5.js'; import './TypeDef.2.js'; /** * Injection mode type. */ type InjectionModeType = 'PROXY' | 'CLASSIC'; /** * Lifetime type. */ type LifetimeType = 'APPLICATION_SINGLETON' | 'MODULE_SINGLETON' | 'SINGLETON' | 'TRANSIENT' | 'SCOPED'; /** * Gets passed the container and is expected to return an object * whose properties are accessible at construction time for the * configured resolver. * * @type {Function} */ type InjectorFunction = <T extends object>(container: IDependencyInjectionContainer<T>) => object; /** * A resolver object returned by asClass(), asFunction() or asValue(). */ interface Resolver<T> extends ResolverOptions<T> { resolve<U extends object>(container: IDependencyInjectionContainer<U>): T; } /** * Options for disposable resolvers. */ interface DisposableResolverOptions<T> extends ResolverOptions<T> { dispose?: Disposer<T>; } /** * Disposer function type. */ type Disposer<T> = (value: T) => any | Promise<any>; /** * The options when registering a class, function or value. * @type RegistrationOptions */ interface ResolverOptions<T> { /** * Only used for inline configuration with `loadModules`. */ name?: string; /** * Lifetime setting. */ lifetime?: LifetimeType; /** * Registration function to use. Only used for inline configuration with `loadModules`. */ register?: (...args: any[]) => Resolver<T>; /** * True if this resolver should be excluded from lifetime leak checking. Used by resolvers that * wish to uphold the anti-leakage contract themselves. Defaults to false. */ isLeakSafe?: boolean; } /** * Builder resolver options. */ interface BuildResolverOptions<T> extends ResolverOptions<T>, DisposableResolverOptions<T> { /** * Resolution mode. */ injectionMode?: InjectionModeType; /** * Injector function to provide additional parameters. */ injector?: InjectorFunction; } /** * A class constructor. For example: * * class MyClass {} * * container.registerClass('myClass', MyClass) * ^^^^^^^ */ type Constructor<T> = { new (...args: any[]): T; }; /** * An object containing the module name and path (full path to module). * * @interface ModuleDescriptor */ interface ModuleDescriptor { name: string; path: string; opts: any; } /** * A glob pattern with associated registration options. */ type GlobWithOptions = [string] | [string, BuildResolverOptions<any> | LifetimeType]; /** * Metadata of the module as well as the loaded module itself. * @interface LoadedModuleDescriptor */ interface LoadedModuleDescriptor extends ModuleDescriptor { value: unknown; } /** * The options when invoking loadModules(). * @interface LoadModulesOptions */ interface LoadModulesOptions<ESM extends boolean = false> { cwd?: string; formatName?: NameFormatter | BuiltInNameFormatters; resolverOptions?: BuildResolverOptions<any>; esModules?: ESM; } /** * Name formatting options when using loadModules(). * @type BuiltInNameFormatters */ type BuiltInNameFormatters = 'camelCase'; /** * Takes in the filename of the module being loaded as well as the module descriptor, * and returns a string which is used to register the module in the container. * * `descriptor.name` is the same as `name`. * * @type {NameFormatter} */ type NameFormatter = (name: string, descriptor: LoadedModuleDescriptor) => string; /** * The container returned from createContainer has some methods and properties. * @interface IDependencyInjectionContainer */ interface IDependencyInjectionContainer<Cradle extends object = any> { /** * Options the container was configured with. */ options: ContainerOptions; /** * The proxy injected when using `PROXY` injection mode. * Can be used as-is. */ readonly cradle: Cradle; /** * Getter for the rolled up registrations that merges the container family tree. */ readonly registrations: RegistrationHash; /** * Resolved modules cache. */ readonly cache: Map<string | symbol, CacheEntry>; /** * Creates a scoped container with this one as the parent. */ createScope<T extends object = object>(): IDependencyInjectionContainer<Cradle & T>; /** * Used by `util.inspect`. */ inspect(depth: number, opts?: any): string; /** * Binds `lib/loadModules` to this container, and provides * real implementations of its dependencies. * * Additionally, any modules using the `dependsOn` API * will be resolved. * * @see src/load-modules.ts documentation. */ loadModules<ESM extends boolean = false>(globPatterns: Array<string | GlobWithOptions>, options?: LoadModulesOptions<ESM>): ESM extends false ? this : Promise<this>; /** * Adds a single registration that using a pre-constructed resolver. */ register<T>(name: string | symbol, registration: Resolver<T>): this; /** * Pairs resolvers to registration names and registers them. */ register(nameAndRegistrationPair: NameAndRegistrationPair<Cradle>): this; /** * Resolves the registration with the given name. * * @param {string} name * The name of the registration to resolve. * * @return {*} * Whatever was resolved. */ resolve<K extends keyof Cradle>(name: K, resolveOptions?: ResolveOptions): Cradle[K]; /** * Resolves the registration with the given name. * * @param {string} name * The name of the registration to resolve. * * @return {*} * Whatever was resolved. */ resolve<T>(name: string | symbol, resolveOptions?: ResolveOptions): T; /** * Checks if the registration with the given name exists. * * @param {string | symbol} name * The name of the registration to resolve. * * @return {boolean} * Whether or not the registration exists. */ hasRegistration(name: string | symbol): boolean; /** * Recursively gets a registration by name if it exists in the * current container or any of its' parents. * * @param name {string | symbol} The registration name. */ getRegistration<K extends keyof Cradle>(name: K): Resolver<Cradle[K]> | null; /** * Recursively gets a registration by name if it exists in the * current container or any of its' parents. * * @param name {string | symbol} The registration name. */ getRegistration<T = unknown>(name: string | symbol): Resolver<T> | null; /** * Given a resolver, class or function, builds it up and returns it. * Does not cache it, this means that any lifetime configured in case of passing * a resolver will not be used. * * @param {Resolver|Class|Function} targetOrResolver * @param {ResolverOptions} opts */ build<T>(targetOrResolver: ClassOrFunctionReturning<T> | Resolver<T>, opts?: BuildResolverOptions<T>): T; /** * Disposes this container and it's children, calling the disposer * on all disposable registrations and clearing the cache. * Only applies to registrations with `SCOPED` or `SINGLETON` lifetime. */ dispose(): Promise<void>; } /** * Optional resolve options. */ interface ResolveOptions { /** * If `true` and `resolve` cannot find the requested dependency, * returns `undefined` rather than throwing an error. */ allowUnregistered?: boolean; } /** * Cache entry. */ interface CacheEntry<T = any> { /** * The resolver that resolved the value. */ resolver: Resolver<T>; /** * The resolved value. */ value: T; } /** * Register a Registration * @interface NameAndRegistrationPair */ type NameAndRegistrationPair<T> = { [U in keyof T]?: Resolver<T[U]>; }; /** * Function that returns T. */ type FunctionReturning<T> = (...args: Array<any>) => T; /** * A class or function returning T. */ type ClassOrFunctionReturning<T> = FunctionReturning<T> | Constructor<T>; /** * The options for the createContainer function. */ interface ContainerOptions { require?: (id: string) => any; injectionMode?: InjectionModeType; strict?: boolean; } /** * Contains a hash of registrations where the name is the key. */ type RegistrationHash = Record<string | symbol | number, Resolver<any>>; declare class AsyncConstructor extends Object { constructor(asyncConstructor: () => PromiseLike<void>); } type BaseObjectConstructor = typeof BaseObject; interface IBaseObjectConstructor<T = any> extends BaseObjectConstructor { new (...args: any[]): T; [prop: string]: any; } type event = (symbol|string); interface ConstructorOptions { /** * @default false * @description set this to `true` to use wildcards. */ wildcard?: boolean, /** * @default '.' * @description the delimiter used to segment namespaces. */ delimiter?: string, /** * @default false * @description set this to `true` if you want to emit the newListener events. */ newListener?: boolean, /** * @default false * @description set this to `true` if you want to emit the removeListener events. */ removeListener?: boolean, /** * @default 10 * @description the maximum amount of listeners that can be assigned to an event. */ maxListeners?: number /** * @default false * @description show event name in memory leak message when more than maximum amount of listeners is assigned, default false */ verboseMemoryLeak?: boolean /** * @default false * @description disable throwing uncaughtException if an error event is emitted and it has no listeners */ ignoreErrors?: boolean } interface ListenerFn { (...values: any[]): void; } interface EventAndListener { (event: string | string[], ...values: any[]): void; } /** * Provider base class */ declare class Provider extends BaseObject { /** * Get environment variable * @param name * @protected */ protected getEnv(name: string): string | undefined; /** * Get environment variable * @param name * @param defaultValue * @protected */ protected getEnv(name: string, defaultValue: string): string; } /** * Component base class */ declare class Component extends Provider { #private; [__init]: (...hooks: (() => Promise<void>)[]) => Promise<void>; [__destroy]: (...hooks: (() => Promise<void>)[]) => Promise<void>; /** * Get container * @protected */ protected get container(): Container; /** * Create sub scope container * @protected */ protected createScope(): Container; /** * emitter.emit(event | eventNS, [arg1], [arg2], [...]) * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. * @param event * @param values */ emit(event: string | symbol | event[], ...values: any[]): boolean; /** * emitter.emitRequest(event | eventNS, [arg1], [arg2], [...]) * Return the results of the listeners via Promise.all. * @param event * @param values */ emitRequest(event: string | symbol | event[], ...values: any[]): Promise<any[]>; /** * Adds a listener to the end of the listeners array for the specified event. * @param event * @param listener */ addListener(event: string | symbol | event[], listener: ListenerFn): this; /** * Adds a listener to the end of the listeners array for the specified event. * @param event * @param listener */ on(event: string | symbol | event[], listener: ListenerFn): this; /** * Adds a listener to the beginning of the listeners array for the specified event. * @param event * @param listener */ prependListener(event: string | symbol | event[], listener: ListenerFn): this; /** * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. * @param event * @param listener */ once(event: string | symbol | event[], listener: ListenerFn): this; /** * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. The listener is added to the beginning of the listeners array * @param event * @param listener */ prependOnceListener(event: string | symbol | event[], listener: ListenerFn): this; /** * Adds a listener that will execute n times for the event before being removed. The listener is invoked only the first n times the event is fired, after which it is removed. * @param event * @param timesToListen * @param listener */ many(event: string | symbol | event[], timesToListen: number, listener: ListenerFn): this; /** * Adds a listener that will execute n times for the event before being removed. The listener is invoked only the first n times the event is fired, after which it is removed. The listener is added to the beginning of the listeners array. * @param event * @param timesToListen * @param listener */ prependMany(event: string | symbol | event[], timesToListen: number, listener: ListenerFn): this; /** * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. * @param listener */ onAny(listener: EventAndListener): this; /** * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. The listener is added to the beginning of the listeners array * @param listener */ prependAny(listener: EventAndListener): this; /** * Removes the listener that will be fired when any event is emitted. * @param listener */ offAny(listener: ListenerFn): this; /** * Remove a specific listener from the listener array for the specified event. * @param event * @param listener */ removeListener(event: string | symbol | event[], listener: ListenerFn): this; /** * emitter.off(event | eventNS, listener) * Remove a listener from the listener array for the specified event. Caution: Calling this method changes the array indices in the listener array behind the listener. * @param event * @param listener */ off(event: string | symbol | event[], listener: ListenerFn): this; /** * emitter.removeAllListeners([event | eventNS]) * Removes all listeners, or those of the specified event. * @param event */ removeAllListeners(event?: string | symbol | event[] | undefined): this; /** * emitter.setMaxListeners(n) * By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. * @param n */ setMaxListeners(n: number): void; /** * emitter.getMaxListeners() * Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) */ getMaxListeners(): number; /** * emitter.eventNames(nsAsArray) * Returns an array listing the events for which the emitter has registered listeners. * Listeners order not guaranteed * @param nsAsArray */ eventNames(nsAsArray?: boolean | undefined): (string | symbol | event[])[]; /** * Returns listener count that are listening for specific event or events * @param event */ listenerCount(event?: string | symbol | event[] | undefined): number; /** * emitter.listeners(event | eventNS) * Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. * @param event */ listeners(event?: string | symbol | event[] | undefined): ListenerFn[]; /** * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. */ listenersAny(): ListenerFn[]; /** * hasListeners(event | eventNS?:String) * Checks whether emitter has any listeners. * @param event */ hasListeners(event?: String | undefined): boolean; /** * Reload self */ reload(): Promise<void>; } declare const OBJECT_ID: unique symbol; declare class LoadObjectOptions<ClassConstructor extends typeof BaseObject = typeof BaseObject> extends DTO { [OBJECT_ID]?: string | symbol; class: ClassConstructor; } declare class LoadNamedObjectOptions extends DTO { [id: string]: LoadObjectOptions; } declare class LoadAnonymousObjectOptions<ClassConstructor extends typeof BaseObject = typeof BaseObject> extends DTO { class: ClassConstructor; } type AnonymousObject = LoadAnonymousObjectOptions | typeof BaseObject | string; declare class ModuleLoadObjectsOptions extends DTO { named?: LoadNamedObjectOptions; anonymous?: AnonymousObject[]; } declare class OverridableObjectOptions<ClassConstructor extends typeof BaseObject = typeof BaseObject> extends DTO { class?: ClassConstructor; } declare class OverridableNamedObjectOptions<ClassConstructor extends IBaseObjectConstructor<BaseObject> = IBaseObjectConstructor<BaseObject>> extends DTO { [id: string]: OverridableObjectOptions<ClassConstructor>; } type BootstrapAsyncFunction<T = any, U = any> = (target: T) => Promise<U>; type BootstrapOption = string | symbol | IBaseObjectConstructor | BootstrapAsyncFunction<Module, void>; declare class ModuleOptions extends DTO { /** * Load components option */ components?: OverridableNamedObjectOptions<IBaseObjectConstructor<Component>>; /** * Load providers option */ providers?: OverridableNamedObjectOptions<IBaseObjectConstructor<Provider>>; /** * Load modules option */ modules?: OverridableNamedObjectOptions<IBaseObjectConstructor<Module>>; /** * Load objects option */ objects?: ModuleLoadObjectsOptions; /** * Bootstrap option */ bootstrap?: BootstrapOption[]; } /** * Object Type */ declare enum ObjectType { Unknown = "Unknown", Object = "Object", Provider = "Provider", Controller = "Controller", Component = "Component", Module = "Module" } /** * Module configurations loader */ declare class ModuleConfigLoader { protected readonly $module: Module; protected readonly $presetLoadOptionsSet: Set<LoadObjectOptions | typeof BaseObject | string>; protected readonly $loadOptions: (LoadObjectOptions | typeof BaseObject | string)[]; protected readonly $bootstrap: BootstrapOption[]; /** * Constructor * @param module * @param moduleOptions * @param presetLoadOptions */ constructor(module: Module, moduleOptions: ModuleOptions, presetLoadOptions?: (LoadObjectOptions | typeof BaseObject | string)[]); /** * Validate constructor's object type * @param expectObjectType * @param target * @protected */ protected validateObjectType<ClassConstructor extends IBaseObjectConstructor>(expectObjectType: ObjectType, target: ClassConstructor): ClassConstructor; /** * Process overridable named object options * @param objectType * @param options * @protected */ protected processOverridableNamedObjectOptions(objectType: ObjectType, options?: OverridableNamedObjectOptions): void; /** * Load options for container.load() */ get loadOptions(): (LoadObjectOptions | typeof BaseObject | string)[]; /** * Load bootstrap for module */ get bootstrap(): BootstrapOption[]; } /** * Module base class */ declare class Module extends Component { #private; [__init]: (...hooks: (() => Promise<void>)[]) => Promise<void>; [__destroy]: (...hooks: (() => Promise<void>)[]) => Promise<void>; /** * Config loader constructor * @protected */ protected readonly ConfigLoader: typeof ModuleConfigLoader; /** * Module embed options * @protected */ protected options: ModuleOptions; /** * Get container * @protected */ protected get container(): Container; /** * Constructor * @param cradleProxy */ constructor(cradleProxy: Record<string | symbol, any>); /** * Get current runtime env is production or development */ mode(): 'development' | 'production'; /** * Reload self */ reload(): Promise<void>; /** * Get registered object via constructor * @param constructor * @param configurableRecords */ getObject<T extends BaseObject>(constructor: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string * @param name * @param configurableRecords */ getObject<T extends BaseObject>(name: string, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via symbol * @param name * @param configurableRecords */ getObject<T extends BaseObject>(name: symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol * @param name * @param configurableRecords * @protected */ getObject<T extends BaseObject>(name: string | symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol or constructor * @param nameOrConstructor * @param configurableRecords * @protected */ getObject<T extends BaseObject>(nameOrConstructor: string | symbol | IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; } /** * Internal init function symbol */ declare const __init: symbol; /** * Internal destroy function symbol */ declare const __destroy: symbol; /** * Lakutata object base class */ declare class BaseObject extends AsyncConstructor { #private; [__init]: (...hooks: (() => Promise<void>)[]) => Promise<void>; [__destroy]: (...hooks: (() => Promise<void>)[]) => Promise<void>; /** * Constructor * @param cradleProxy */ constructor(cradleProxy: Record<string | symbol, any>); /** * Return class's name */ static get className(): string; /** * Get instance's class name */ get className(): string; /** * Initializer * @protected */ protected init(): Promise<void>; /** * Destroyer * @protected */ protected destroy(): Promise<void>; /** * Get registered object via constructor * @param constructor * @param configurableRecords */ protected getObject<T extends BaseObject>(constructor: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string * @param name * @param configurableRecords */ protected getObject<T extends BaseObject>(name: string, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via symbol * @param name * @param configurableRecords */ protected getObject<T extends BaseObject>(name: symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol * @param name * @param configurableRecords * @protected */ protected getObject<T extends BaseObject>(name: string | symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol or constructor * @param nameOrConstructor * @param configurableRecords * @protected */ protected getObject<T extends BaseObject>(nameOrConstructor: string | symbol | IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Instantiate an instance of a base object class by injecting dependencies, but without registering it in the container * @param constructor * @param configurableRecords * @protected */ protected buildObject<T extends BaseObject>(constructor: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Get current object's parent * @protected */ protected getParent(): BaseObject | undefined; /** * Get current object's parent module * @protected */ protected getModule(): Module; /** * Unique object uuid */ get $uuid(): string; /** * Object instance id which defined in runtime */ get $id(): string | symbol; /** * Object instance symbol */ get $symbol(): symbol; /** * Set object property * @param propertyKey * @param value */ setProperty(propertyKey: string, value: any): void; /** * Get object's property value * @param propertyKey * @param defaultValue */ getProperty<T = any>(propertyKey: string, defaultValue?: T): T; /** * Is object has property * @param propertyKey */ hasProperty(propertyKey: string | symbol): boolean; /** * Get own property symbols */ propertySymbols(): symbol[]; /** * Get own property names */ propertyNames(): string[]; /** * Is object has method * @param name */ hasMethod(name: string | symbol): boolean; /** * Get method from object * @param name * @param throwExceptionIfNotFound */ getMethod(name: string | symbol, throwExceptionIfNotFound?: boolean): (...args: any[]) => any | Promise<any>; /** * Dispose current object * @description Call this function will invoke internal destroy method */ dispose(): Promise<void>; } declare class Container { #private; readonly parent?: Container; constructor(parent?: Container, owner?: BaseObject); /** * Destroy objects inside container * @param instance * @protected */ protected disposer<T extends BaseObject>(instance: T): Promise<void>; /** * Get build resolver options by class constructor * @param target * @protected */ protected buildResolverOptions<T extends BaseObject>(target: IBaseObjectConstructor<T>): BuildResolverOptions<T>; /** * Process resolved * @param resolved * @param registrationName * @param configurableRecords * @protected */ protected processResolved<T extends BaseObject>(resolved: T | Promise<T>, registrationName: string | symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Build name and registration pair from container load options * @param options * @protected */ protected buildNameAndRegistrationPairFromOptions<T extends BaseObject>(options: LoadObjectOptions): NameAndRegistrationPair<T>; /** * Build name and registration pair from glob * @param glob * @protected */ protected buildNameAndRegistrationPairFromGlob<T extends typeof BaseObject>(glob: string): Promise<NameAndRegistrationPair<T>>; /** * Get current container owner */ owner<Owner extends BaseObject = BaseObject>(): Owner | undefined; protected injectionNames: Set<string | symbol>; /** * Load objects * @param options */ load<T extends typeof BaseObject>(options: (LoadObjectOptions | typeof BaseObject | string)[]): Promise<void>; /** * Get registered object via constructor * @param constructor * @param configurableRecords */ get<T extends BaseObject>(constructor: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string * @param name * @param configurableRecords */ get<T extends BaseObject>(name: string, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via symbol * @param name * @param configurableRecords */ get<T extends BaseObject>(name: symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol * @param name * @param configurableRecords */ get<T extends BaseObject>(name: string | symbol, configurableRecords?: Record<string, any>): Promise<T>; /** * Get registered object via string or symbol or constructor * @param nameOrConstructor * @param configurableRecords */ get<T extends BaseObject>(nameOrConstructor: string | symbol | IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Is object registered in container (By symbol) * @param symbol */ has(symbol: symbol): boolean; /** * Is object registered in container (By name) * @param name */ has(name: string): boolean; /** * Is object registered in container (By name or symbol) * @param nameOrSymbol */ has(nameOrSymbol: string | symbol): boolean; /** * Is object registered in container (By constructor) * @param constructor */ has<ClassConstructor extends typeof BaseObject>(constructor: ClassConstructor): boolean; /** * Builds an instance of a base object class by injecting dependencies, and registering it in the container * @param target * @param configurableRecords */ set<T extends BaseObject>(target: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Builds a named instance of a base object class by injecting dependencies, and registering it in the container * @param name * @param target * @param configurableRecords */ setNamed<T extends BaseObject>(name: string | symbol, target: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Register base object class in the container * @param target * @param configurableRecords */ register<T extends BaseObject>(target: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<void>; /** * Register named base object class in the container * @param name * @param target * @param configurableRecords */ registerNamed<T extends BaseObject>(name: string | symbol, target: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<void>; /** * Builds an instance of a base object class by injecting dependencies, but without registering it in the container * @param target * @param configurableRecords */ build<T extends BaseObject>(target: IBaseObjectConstructor<T>, configurableRecords?: Record<string, any>): Promise<T>; /** * Create sub container scope */ createScope(): Container; /** * Register current container to its parent subContainerSet */ registerContainerToItsParent(): void; /** * Clear current container but not destroy it */ clear(): Promise<void>; /** * Destroy current container */ destroy(): Promise<void>; } export { BaseObject as B, Component as C, Module as M, OverridableNamedObjectOptions as O, Provider as P, ModuleOptions as a, ModuleConfigLoader as b, LoadObjectOptions as c, Container as g, LoadAnonymousObjectOptions as h, LoadNamedObjectOptions as i, ModuleLoadObjectsOptions as j, OverridableObjectOptions as k }; export type { EventAndListener as E, IBaseObjectConstructor as I, LifetimeType as L, ConstructorOptions as d, event as e, ListenerFn as f };