mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added inversify type definitions
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
interface TypeBindingInterface<TServiceType> {
|
||||
runtimeIdentifier : string;
|
||||
implementationType : { new(): TServiceType ;};
|
||||
cache : TServiceType;
|
||||
scope : number; // TypeBindingScopeEnum
|
||||
}
|
||||
|
||||
interface KernelInterface {
|
||||
bind(typeBinding : TypeBindingInterface<any>) : void;
|
||||
unbind(runtimeIdentifier : string) : void;
|
||||
unbindAll() : void;
|
||||
resolve<TImplementationType>(runtimeIdentifier : string) : TImplementationType;
|
||||
}
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
/// <reference path="interfaces.d.ts" />
|
||||
|
||||
declare enum TypeBindingScopeEnum {
|
||||
Transient = 0,
|
||||
Singleton = 1,
|
||||
}
|
||||
|
||||
declare class TypeBinding<TServiceType> implements TypeBindingInterface<TServiceType> {
|
||||
runtimeIdentifier: string;
|
||||
implementationType: {
|
||||
new (): TServiceType;
|
||||
};
|
||||
cache: TServiceType;
|
||||
scope: TypeBindingScopeEnum;
|
||||
constructor(runtimeIdentifier: string, implementationType: {
|
||||
new (...args: any[]): TServiceType;
|
||||
}, scopeType?: TypeBindingScopeEnum);
|
||||
}
|
||||
|
||||
declare class Kernel implements KernelInterface {
|
||||
private _bindings;
|
||||
bind(typeBinding: TypeBindingInterface<any>): void;
|
||||
unbind(runtimeIdentifier: string): void;
|
||||
unbindAll(): void;
|
||||
resolve<TImplementationType>(runtimeIdentifier: string): TImplementationType;
|
||||
private _validateBinding(typeBinding);
|
||||
private _getConstructorArguments(func);
|
||||
private _injectDependencies<TImplementationType>(func);
|
||||
private _construct<TImplementationType>(constr, args);
|
||||
constructor();
|
||||
}
|
||||
|
||||
declare var inversify: {
|
||||
Kernel: typeof Kernel;
|
||||
TypeBindingScopeEnum: typeof TypeBindingScopeEnum;
|
||||
TypeBinding: typeof TypeBinding;
|
||||
};
|
||||
Reference in New Issue
Block a user