Comparing version 2.0.3 to 2.0.4
@@ -14,3 +14,3 @@ import { Constructor, Container, RegistrationType, AbstractConstructor, ImplementationType } from './types'; | ||
registerInstance<TInstance extends Object>(instance: TInstance): { | ||
as: <TBase extends Partial<TInstance>>(type: Constructor<TBase>) => void; | ||
as: <TBase extends Partial<TInstance>>(type: RegistrationType<TBase>) => void; | ||
}; | ||
@@ -17,0 +17,0 @@ private getImplementation; |
declare type AbstractConstructor<T = any> = abstract new (...args: any[]) => T; | ||
declare type Constructor<T = any> = new (...args: any[]) => T; | ||
declare type Dependency<T = any> = (Constructor<T> | AbstractConstructor<T>); | ||
declare type ImplementationType<TInstance> = Constructor<TInstance> & { | ||
declare type ImplementationType<TClass> = Constructor<TClass> & { | ||
__dependencies?: Dependency[]; | ||
@@ -12,4 +12,4 @@ }; | ||
interface DependencyRegistrator { | ||
registerType: <TInstance>(implementationType: ImplementationType<TInstance>) => { | ||
as: <TBase extends Partial<TInstance>>(type: RegistrationType<TBase>) => { | ||
registerType: <TClass>(implementationType: ImplementationType<TClass>) => { | ||
as: <TBase extends Partial<TClass>>(type: RegistrationType<TBase>) => { | ||
with: (...injectionParams: any[]) => void; | ||
@@ -20,3 +20,3 @@ }; | ||
registerInstance: <TInstance extends Object>(instance: TInstance) => { | ||
as: <TBase extends Partial<TInstance>>(type: Constructor<TBase>) => void; | ||
as: <TBase extends Partial<TInstance>>(type: RegistrationType<TBase>) => void; | ||
}; | ||
@@ -23,0 +23,0 @@ } |
{ | ||
"name": "cheap-di", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "JavaScript dependency injection like Autofac in .Net", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16955