##// END OF EJS Templates
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version

File last commit:

r146:f3f5c56d3b3e v1.4.0-rc5 default
r146:f3f5c56d3b3e v1.4.0-rc5 default
Show More
interfaces.ts
65 lines | 2.2 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / di / interfaces.ts
cin
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
r146 import { IDestroyable } from "../interfaces";
cin
changed the project structure
r49 import { ActivationContext } from "./ActivationContext";
cin
Fixed container interfaces, separated ServiceContainer
r144 import { LifetimeManager } from "./LifetimeManager";
cin
changed the project structure
r49
cin
improved interfaces and more tight type checking
r120 export interface Descriptor<S extends object = any, T = any> {
cin
corrected code to support ts strict mode...
r115 activate(context: ActivationContext<S>): T;
cin
changed the project structure
r49 }
cin
improved interfaces and more tight type checking
r120 export type ServiceMap<S extends object> = {
cin
configuration interfaces moved to di/Configuration module...
r118 [k in keyof S]: Descriptor<S, S[k]>;
cin
corrected code to support ts strict mode...
r115 };
cin
improved interfaces and more tight type checking
r120 export type ContainerKeys<S extends object> = keyof S | keyof ContainerProvided<S>;
cin
working on fluent configuration
r133 export type TypeOfService<S extends object, K> =
cin
improved interfaces and more tight type checking
r120 K extends keyof ContainerProvided<S> ? ContainerProvided<S>[K] :
K extends keyof S ? S[K] : never;
export type ContainerServiceMap<S extends object> = {
cin
working on fluent configuration
r133 [K in ContainerKeys<S>]: Descriptor<S, TypeOfService<S, K>>;
cin
improved interfaces and more tight type checking
r120 };
export type PartialServiceMap<S extends object> = {
cin
configuration interfaces moved to di/Configuration module...
r118 [k in keyof S]?: Descriptor<S, S[k]>;
};
cin
corrected code to support ts strict mode...
r115
cin
working on fluent configuration
r133 export interface ServiceLocator<S extends object> {
resolve<K extends ContainerKeys<S>>(name: K, def?: TypeOfService<S, K>): TypeOfService<S, K>;
cin
improved interfaces and more tight type checking
r120 }
cin
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
r146 export interface ServiceContainer<S extends object> extends ServiceLocator<S>, IDestroyable {
cin
Fixed container interfaces, separated ServiceContainer
r144 getLifetimeManager(): LifetimeManager;
register<K extends keyof S>(name: K, service: Descriptor<S, S[K]>): this;
register(services: PartialServiceMap<S>): this;
createChildContainer(): ServiceContainer<S>;
}
cin
improved interfaces and more tight type checking
r120 export interface ContainerProvided<S extends object> {
cin
working on fluent configuration
r133 container: ServiceLocator<S>;
cin
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
r146
childContainer: ServiceContainer<S>;
cin
corrected code to support ts strict mode...
r115 }
cin
improved interfaces and more tight type checking
r120
export type ContainerRegistered<S extends object> = /*{
[K in Exclude<keyof S, keyof ContainerProvided<S>>]: S[K];
};*/
Exclude<S, ContainerProvided<S>>;
cin
configuration interfaces moved to di/Configuration module...
r118 export type ActivationType = "singleton" | "container" | "hierarchy" | "context" | "call";
cin
working on lifetime management
r129
cin
working on fluent configuration
r133 /**
* Интерфейс для управления жизнью экземпляра объекта. Каждая регистрация имеет
* свой собственный объект `ILifetime`, который создается при первой активации
*/
cin
working on lifetime management
r129 export interface ILifetime {
cin
working on fluent configuration
r133 /** Проверяет, что уже создан экземпляр объекта */
cin
working on lifetime management
r129 has(): boolean;
cin
working on services lifetime
r130
cin
working on lifetime management
r129 get(): any;
cin
working on services lifetime
r130
cin
working on fluent configuration, di annotations removed
r134 initialize(context: ActivationContext<any>): void;
cin
working on services lifetime
r130
cin
working on lifetime management
r129 store(item: any, cleanup?: (item: any) => void): void;
cin
working on fluent configuration
r132 }