inversify
- Version 6.0.1
- Published
- 1.87 MB
- No dependencies
- MIT license
Install
npm i inversify
yarn add inversify
pnpm add inversify
Overview
A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.
Index
Variables
Functions
Classes
Container
- applyCustomMetadataReader()
- applyMiddleware()
- bind()
- createChild()
- get()
- getAll()
- getAllAsync()
- getAllNamed()
- getAllNamedAsync()
- getAllTagged()
- getAllTaggedAsync()
- getAsync()
- getNamed()
- getNamedAsync()
- getTagged()
- getTaggedAsync()
- id
- isBound()
- isBoundNamed()
- isBoundTagged()
- isCurrentBound()
- load()
- loadAsync()
- merge()
- onActivation()
- onDeactivation()
- options
- parent
- rebind()
- rebindAsync()
- resolve()
- restore()
- snapshot()
- unbind()
- unbindAll()
- unbindAllAsync()
- unbindAsync()
- unload()
- unloadAsync()
Namespaces
interfaces
- Abstract
- AsyncContainerModule
- AsyncContainerModuleCallBack
- AutoFactory
- AutoNamedFactory
- Bind
- Binding
- BindingActivation
- BindingDeactivation
- BindingInSyntax
- BindingInWhenOnSyntax
- BindingOnSyntax
- BindingScope
- BindingScopeEnum
- BindingToSyntax
- BindingType
- BindingTypeEnum
- BindingWhenOnSyntax
- BindingWhenSyntax
- Clonable
- ConstraintFunction
- ConstructorMetadata
- Container
- ContainerModule
- ContainerModuleBase
- ContainerModuleCallBack
- ContainerOptions
- ContainerResolution
- ContainerSnapshot
- Context
- ContextInterceptor
- DynamicValue
- Factory
- FactoryCreator
- FactoryDetails
- FactoryTypeFunction
- IsBound
- Lookup
- Metadata
- MetadataMap
- MetadataOrMetadataArray
- MetadataReader
- Middleware
- ModuleActivationHandlers
- ModuleActivationStore
- MultiFactory
- Newable
- Next
- NextArgs
- Plan
- Provider
- ProviderCreator
- QueryableString
- Rebind
- Request
- RequestScope
- ResolveRequestHandler
- ServiceIdentifier
- SimpleFactory
- Target
- TargetType
- TargetTypeEnum
- Unbind
- UnbindAsync
Variables
variable BindingScopeEnum
const BindingScopeEnum: interfaces.BindingScopeEnum;
variable BindingTypeEnum
const BindingTypeEnum: interfaces.BindingTypeEnum;
variable METADATA_KEY
const METADATA_KEY: typeof keys;
variable TargetTypeEnum
const TargetTypeEnum: interfaces.TargetTypeEnum;
Functions
function createTaggedDecorator
createTaggedDecorator: ( metadata: interfaces.MetadataOrMetadataArray) => <T>( target: DecoratorTarget, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
function decorate
decorate: ( decorator: DecoratorTarget | ParameterDecorator | MethodDecorator, target: any, parameterIndexOrProperty?: number | string) => void;
function getServiceIdentifierAsString
getServiceIdentifierAsString: ( serviceIdentifier: interfaces.ServiceIdentifier) => string;
function id
id: () => number;
function inject
inject: <T = unknown>( serviceIdentifier: ServiceIdentifierOrFunc<T>) => ( target: import('./decorator_utils').DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<any> | undefined) => void;
function injectable
injectable: () => <T extends abstract new (...args: never) => unknown>( target: T) => T;
function multiBindToService
multiBindToService: ( container: interfaces.Container) => ( service: interfaces.ServiceIdentifier) => (...types: interfaces.ServiceIdentifier[]) => void;
function multiInject
multiInject: <T = unknown>( serviceIdentifier: ServiceIdentifierOrFunc<T>) => ( target: import('./decorator_utils').DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<any> | undefined) => void;
function named
named: ( name: string | number | symbol) => <T>( target: import('./decorator_utils').DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
function namedConstraint
namedConstraint: (value: unknown) => interfaces.ConstraintFunction;
function optional
optional: () => <T>( target: import('./decorator_utils').DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T>) => void;
function postConstruct
postConstruct: () => ( target: { constructor: NewableFunction }, propertyKey: string) => void;
function preDestroy
preDestroy: () => ( target: { constructor: NewableFunction }, propertyKey: string) => void;
function tagged
tagged: <T>( metadataKey: string | number | symbol, metadataValue: unknown) => <T_1>( target: import('./decorator_utils').DecoratorTarget<unknown>, targetKey?: string | symbol | undefined, indexOrPropertyDescriptor?: number | TypedPropertyDescriptor<T_1>) => void;
function taggedConstraint
taggedConstraint: ( key: string | number | symbol) => (value: unknown) => interfaces.ConstraintFunction;
function targetName
targetName: ( name: string) => (target: DecoratorTarget, targetKey: string, index: number) => void;
function traverseAncerstors
traverseAncerstors: ( request: interfaces.Request, constraint: interfaces.ConstraintFunction) => boolean;
function typeConstraint
typeConstraint: ( type: NewableFunction | string) => (request: interfaces.Request | null) => boolean;
function unmanaged
unmanaged: () => ( target: DecoratorTarget, targetKey: string, index: number) => void;
Classes
class AsyncContainerModule
class AsyncContainerModule implements interfaces.AsyncContainerModule {}
constructor
constructor( registry: ( bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind, unbindAsync: interfaces.UnbindAsync, onActivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onActivation: interfaces.BindingActivation<T> ) => void, onDeactivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onDeactivation: interfaces.BindingDeactivation<T> ) => void ) => Promise<void>);
property id
id: number;
property registry
registry: ( bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind, unbindAsync: interfaces.UnbindAsync, onActivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onActivation: interfaces.BindingActivation<T> ) => void, onDeactivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onDeactivation: interfaces.BindingDeactivation<T> ) => void) => Promise<void>;
class Container
class Container implements interfaces.Container {}
constructor
constructor(containerOptions?: interfaces.ContainerOptions);
property id
id: number;
property options
readonly options: interfaces.ContainerOptions;
property parent
parent: interfaces.Container;
method applyCustomMetadataReader
applyCustomMetadataReader: (metadataReader: interfaces.MetadataReader) => void;
method applyMiddleware
applyMiddleware: (...middlewares: interfaces.Middleware[]) => void;
method bind
bind: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => interfaces.BindingToSyntax<T>;
method createChild
createChild: (containerOptions?: interfaces.ContainerOptions) => Container;
method get
get: <T>(serviceIdentifier: interfaces.ServiceIdentifier<T>) => T;
method getAll
getAll: <T>(serviceIdentifier: interfaces.ServiceIdentifier<T>) => T[];
method getAllAsync
getAllAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => Promise<T[]>;
method getAllNamed
getAllNamed: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol) => T[];
method getAllNamedAsync
getAllNamedAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol) => Promise<T[]>;
method getAllTagged
getAllTagged: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => T[];
method getAllTaggedAsync
getAllTaggedAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => Promise<T[]>;
method getAsync
getAsync: <T>(serviceIdentifier: interfaces.ServiceIdentifier<T>) => Promise<T>;
method getNamed
getNamed: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol) => T;
method getNamedAsync
getNamedAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol) => Promise<T>;
method getTagged
getTagged: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => T;
method getTaggedAsync
getTaggedAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => Promise<T>;
method isBound
isBound: (serviceIdentifier: interfaces.ServiceIdentifier<any>) => boolean;
method isBoundNamed
isBoundNamed: ( serviceIdentifier: interfaces.ServiceIdentifier, named: string | number | symbol) => boolean;
method isBoundTagged
isBoundTagged: ( serviceIdentifier: interfaces.ServiceIdentifier, key: string | number | symbol, value: unknown) => boolean;
method isCurrentBound
isCurrentBound: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => boolean;
method load
load: (...modules: interfaces.ContainerModule[]) => void;
method loadAsync
loadAsync: (...modules: interfaces.AsyncContainerModule[]) => Promise<void>;
method merge
static merge: ( container1: interfaces.Container, container2: interfaces.Container, ...containers: interfaces.Container[]) => interfaces.Container;
method onActivation
onActivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onActivation: interfaces.BindingActivation<T>) => void;
method onDeactivation
onDeactivation: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>, onDeactivation: interfaces.BindingDeactivation<T>) => void;
method rebind
rebind: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => interfaces.BindingToSyntax<T>;
method rebindAsync
rebindAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => Promise<interfaces.BindingToSyntax<T>>;
method resolve
resolve: <T>(constructorFunction: interfaces.Newable<T>) => T;
method restore
restore: () => void;
method snapshot
snapshot: () => void;
method unbind
unbind: (serviceIdentifier: interfaces.ServiceIdentifier) => void;
method unbindAll
unbindAll: () => void;
method unbindAllAsync
unbindAllAsync: () => Promise<void>;
method unbindAsync
unbindAsync: (serviceIdentifier: interfaces.ServiceIdentifier) => Promise<void>;
method unload
unload: (...modules: interfaces.ContainerModuleBase[]) => void;
method unloadAsync
unloadAsync: (...modules: interfaces.ContainerModuleBase[]) => Promise<void>;
class ContainerModule
class ContainerModule implements interfaces.ContainerModule {}
constructor
constructor(registry: interfaces.ContainerModuleCallBack);
property id
id: number;
property registry
registry: interfaces.ContainerModuleCallBack;
class LazyServiceIdentifer
class LazyServiceIdentifer<T = unknown> {}
constructor
constructor(cb: () => interfaces.ServiceIdentifier<T>);
method unwrap
unwrap: () => interfaces.ServiceIdentifier<T>;
class MetadataReader
class MetadataReader implements interfaces.MetadataReader {}
method getConstructorMetadata
getConstructorMetadata: ( constructorFunc: NewableFunction) => interfaces.ConstructorMetadata;
method getPropertiesMetadata
getPropertiesMetadata: ( constructorFunc: NewableFunction) => interfaces.MetadataMap;
Namespaces
namespace interfaces
namespace interfaces {}
interface AsyncContainerModule
interface AsyncContainerModule extends ContainerModuleBase {}
property registry
registry: AsyncContainerModuleCallBack;
interface Binding
interface Binding<TActivated> extends Clonable<Binding<TActivated>> {}
property activated
activated: boolean;
property cache
cache: null | TActivated | Promise<TActivated>;
property constraint
constraint: ConstraintFunction;
property dynamicValue
dynamicValue: DynamicValue<TActivated> | null;
property factory
factory: FactoryCreator<unknown> | null;
property id
id: number;
property implementationType
implementationType: Newable<TActivated> | TActivated | null;
property moduleId
moduleId: ContainerModuleBase['id'];
property onActivation
onActivation: BindingActivation<TActivated> | null;
property onDeactivation
onDeactivation: BindingDeactivation<TActivated> | null;
property provider
provider: ProviderCreator<unknown> | null;
property scope
scope: BindingScope;
property serviceIdentifier
serviceIdentifier: ServiceIdentifier<TActivated>;
property type
type: BindingType;
interface BindingInSyntax
interface BindingInSyntax<T> {}
method inRequestScope
inRequestScope: () => BindingWhenOnSyntax<T>;
method inSingletonScope
inSingletonScope: () => BindingWhenOnSyntax<T>;
method inTransientScope
inTransientScope: () => BindingWhenOnSyntax<T>;
interface BindingInWhenOnSyntax
interface BindingInWhenOnSyntax<T> extends BindingInSyntax<T>, BindingWhenOnSyntax<T> {}
interface BindingOnSyntax
interface BindingOnSyntax<T> {}
method onActivation
onActivation: ( fn: (context: Context, injectable: T) => T | Promise<T>) => BindingWhenSyntax<T>;
method onDeactivation
onDeactivation: ( fn: (injectable: T) => void | Promise<void>) => BindingWhenSyntax<T>;
interface BindingScopeEnum
interface BindingScopeEnum {}
interface BindingToSyntax
interface BindingToSyntax<T> {}
method to
to: (constructor: new (...args: never[]) => T) => BindingInWhenOnSyntax<T>;
method toAutoFactory
toAutoFactory: <T2>( serviceIdentifier: ServiceIdentifier<T2>) => BindingWhenOnSyntax<T>;
method toAutoNamedFactory
toAutoNamedFactory: <T2>( serviceIdentifier: ServiceIdentifier<T2>) => BindingWhenOnSyntax<T>;
method toConstantValue
toConstantValue: (value: T) => BindingWhenOnSyntax<T>;
method toConstructor
toConstructor: <T2>(constructor: Newable<T2>) => BindingWhenOnSyntax<T>;
method toDynamicValue
toDynamicValue: (func: DynamicValue<T>) => BindingInWhenOnSyntax<T>;
method toFactory
toFactory: < T2, T3 extends unknown[] = unknown[], T4 extends unknown[] = unknown[]>( factory: FactoryCreator<T2, T3, T4>) => BindingWhenOnSyntax<T>;
method toFunction
toFunction: (func: T) => BindingWhenOnSyntax<T>;
method toProvider
toProvider: <T2>(provider: ProviderCreator<T2>) => BindingWhenOnSyntax<T>;
method toSelf
toSelf: () => BindingInWhenOnSyntax<T>;
method toService
toService: (service: ServiceIdentifier<T>) => void;
interface BindingTypeEnum
interface BindingTypeEnum {}
property ConstantValue
ConstantValue: interfaces.BindingType;
property Constructor
Constructor: interfaces.BindingType;
property DynamicValue
DynamicValue: interfaces.BindingType;
property Factory
Factory: interfaces.BindingType;
property Function
Function: interfaces.BindingType;
property Instance
Instance: interfaces.BindingType;
property Invalid
Invalid: interfaces.BindingType;
property Provider
Provider: interfaces.BindingType;
interface BindingWhenOnSyntax
interface BindingWhenOnSyntax<T> extends BindingWhenSyntax<T>, BindingOnSyntax<T> {}
interface BindingWhenSyntax
interface BindingWhenSyntax<T> {}
method when
when: (constraint: (request: Request) => boolean) => BindingOnSyntax<T>;
method whenAnyAncestorIs
whenAnyAncestorIs: (ancestor: NewableFunction | string) => BindingOnSyntax<T>;
method whenAnyAncestorMatches
whenAnyAncestorMatches: ( constraint: (request: Request) => boolean) => BindingOnSyntax<T>;
method whenAnyAncestorNamed
whenAnyAncestorNamed: (name: string | number | symbol) => BindingOnSyntax<T>;
method whenAnyAncestorTagged
whenAnyAncestorTagged: ( tag: string | number | symbol, value: unknown) => BindingOnSyntax<T>;
method whenInjectedInto
whenInjectedInto: (parent: NewableFunction | string) => BindingOnSyntax<T>;
method whenNoAncestorIs
whenNoAncestorIs: (ancestor: NewableFunction | string) => BindingOnSyntax<T>;
method whenNoAncestorMatches
whenNoAncestorMatches: ( constraint: (request: Request) => boolean) => BindingOnSyntax<T>;
method whenNoAncestorNamed
whenNoAncestorNamed: (name: string | number | symbol) => BindingOnSyntax<T>;
method whenNoAncestorTagged
whenNoAncestorTagged: ( tag: string | number | symbol, value: unknown) => BindingOnSyntax<T>;
method whenParentNamed
whenParentNamed: (name: string | number | symbol) => BindingOnSyntax<T>;
method whenParentTagged
whenParentTagged: ( tag: string | number | symbol, value: unknown) => BindingOnSyntax<T>;
method whenTargetIsDefault
whenTargetIsDefault: () => BindingOnSyntax<T>;
method whenTargetNamed
whenTargetNamed: (name: string | number | symbol) => BindingOnSyntax<T>;
method whenTargetTagged
whenTargetTagged: ( tag: string | number | symbol, value: unknown) => BindingOnSyntax<T>;
interface ConstraintFunction
interface ConstraintFunction {}
property metaData
metaData?: Metadata;
call signature
(request: Request | null): boolean;
interface ConstructorMetadata
interface ConstructorMetadata {}
property compilerGeneratedMetadata
compilerGeneratedMetadata: NewableFunction[] | undefined;
property userGeneratedMetadata
userGeneratedMetadata: MetadataMap;
interface Container
interface Container {}
property id
id: number;
property options
options: ContainerOptions;
property parent
parent: Container | null;
method applyCustomMetadataReader
applyCustomMetadataReader: (metadataReader: MetadataReader) => void;
method applyMiddleware
applyMiddleware: (...middleware: Middleware[]) => void;
method bind
bind: <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
method createChild
createChild: () => Container;
method get
get: <T>(serviceIdentifier: ServiceIdentifier<T>) => T;
method getAll
getAll: <T>(serviceIdentifier: ServiceIdentifier<T>) => T[];
method getAllAsync
getAllAsync: <T>(serviceIdentifier: ServiceIdentifier<T>) => Promise<T[]>;
method getAllNamed
getAllNamed: <T>( serviceIdentifier: ServiceIdentifier<T>, named: string | number | symbol) => T[];
method getAllNamedAsync
getAllNamedAsync: <T>( serviceIdentifier: ServiceIdentifier<T>, named: string | number | symbol) => Promise<T[]>;
method getAllTagged
getAllTagged: <T>( serviceIdentifier: ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => T[];
method getAllTaggedAsync
getAllTaggedAsync: <T>( serviceIdentifier: ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => Promise<T[]>;
method getAsync
getAsync: <T>(serviceIdentifier: ServiceIdentifier<T>) => Promise<T>;
method getNamed
getNamed: <T>( serviceIdentifier: ServiceIdentifier<T>, named: string | number | symbol) => T;
method getNamedAsync
getNamedAsync: <T>( serviceIdentifier: ServiceIdentifier<T>, named: string | number | symbol) => Promise<T>;
method getTagged
getTagged: <T>( serviceIdentifier: ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => T;
method getTaggedAsync
getTaggedAsync: <T>( serviceIdentifier: ServiceIdentifier<T>, key: string | number | symbol, value: unknown) => Promise<T>;
method isBound
isBound: (serviceIdentifier: ServiceIdentifier) => boolean;
method isBoundNamed
isBoundNamed: ( serviceIdentifier: ServiceIdentifier, named: string | number | symbol) => boolean;
method isBoundTagged
isBoundTagged: ( serviceIdentifier: ServiceIdentifier, key: string | number | symbol, value: unknown) => boolean;
method isCurrentBound
isCurrentBound: <T>(serviceIdentifier: ServiceIdentifier<T>) => boolean;
method load
load: (...modules: ContainerModule[]) => void;
method loadAsync
loadAsync: (...modules: AsyncContainerModule[]) => Promise<void>;
method onActivation
onActivation: <T>( serviceIdentifier: ServiceIdentifier<T>, onActivation: BindingActivation<T>) => void;
method onDeactivation
onDeactivation: <T>( serviceIdentifier: ServiceIdentifier<T>, onDeactivation: BindingDeactivation<T>) => void;
method rebind
rebind: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => interfaces.BindingToSyntax<T>;
method rebindAsync
rebindAsync: <T>( serviceIdentifier: interfaces.ServiceIdentifier<T>) => Promise<interfaces.BindingToSyntax<T>>;
method resolve
resolve: <T>(constructorFunction: interfaces.Newable<T>) => T;
method restore
restore: () => void;
method snapshot
snapshot: () => void;
method unbind
unbind: (serviceIdentifier: ServiceIdentifier) => void;
method unbindAll
unbindAll: () => void;
method unbindAllAsync
unbindAllAsync: () => Promise<void>;
method unbindAsync
unbindAsync: (serviceIdentifier: interfaces.ServiceIdentifier) => Promise<void>;
method unload
unload: (...modules: ContainerModuleBase[]) => void;
method unloadAsync
unloadAsync: (...modules: ContainerModuleBase[]) => Promise<void>;
interface ContainerModule
interface ContainerModule extends ContainerModuleBase {}
property registry
registry: ContainerModuleCallBack;
interface ContainerModuleBase
interface ContainerModuleBase {}
property id
id: number;
interface ContainerOptions
interface ContainerOptions {}
property autoBindInjectable
autoBindInjectable?: boolean;
property defaultScope
defaultScope?: BindingScope;
property skipBaseClassChecks
skipBaseClassChecks?: boolean;
interface ContainerSnapshot
interface ContainerSnapshot {}
property activations
activations: Lookup<BindingActivation<unknown>>;
property bindings
bindings: Lookup<Binding<unknown>>;
property deactivations
deactivations: Lookup<BindingDeactivation<unknown>>;
property middleware
middleware: Next | null;
property moduleActivationStore
moduleActivationStore: interfaces.ModuleActivationStore;
interface Context
interface Context {}
property container
container: Container;
property currentRequest
currentRequest: Request;
property id
id: number;
property plan
plan: Plan;
method addPlan
addPlan: (plan: Plan) => void;
method setCurrentRequest
setCurrentRequest: (request: Request) => void;
interface FactoryDetails
interface FactoryDetails {}
property factory
factory: FactoryTypeFunction | null;
property factoryType
factoryType: FactoryType;
interface Lookup
interface Lookup<T> extends Clonable<Lookup<T>> {}
method add
add: (serviceIdentifier: ServiceIdentifier, value: T) => void;
method clone
clone: () => Lookup<T>;
method get
get: (serviceIdentifier: ServiceIdentifier) => T[];
method getMap
getMap: () => Map<interfaces.ServiceIdentifier, T[]>;
method hasKey
hasKey: (serviceIdentifier: ServiceIdentifier) => boolean;
method remove
remove: (serviceIdentifier: interfaces.ServiceIdentifier) => void;
method removeByCondition
removeByCondition: (condition: (item: T) => boolean) => T[];
method removeIntersection
removeIntersection: (lookup: interfaces.Lookup<T>) => void;
method traverse
traverse: ( func: (key: interfaces.ServiceIdentifier, value: T[]) => void) => void;
interface Metadata
interface Metadata<TValue = unknown> {}
interface MetadataMap
interface MetadataMap {}
index signature
[propertyNameOrArgumentIndex: string | symbol]: Metadata[];
interface MetadataReader
interface MetadataReader {}
method getConstructorMetadata
getConstructorMetadata: ( constructorFunc: NewableFunction) => ConstructorMetadata;
method getPropertiesMetadata
getPropertiesMetadata: (constructorFunc: NewableFunction) => MetadataMap;
interface ModuleActivationHandlers
interface ModuleActivationHandlers {}
property onActivations
onActivations: Lookup<BindingActivation<unknown>>;
property onDeactivations
onDeactivations: Lookup<BindingDeactivation<unknown>>;
interface ModuleActivationStore
interface ModuleActivationStore extends Clonable<ModuleActivationStore> {}
method addActivation
addActivation: ( moduleId: ContainerModuleBase['id'], serviceIdentifier: ServiceIdentifier<unknown>, onActivation: interfaces.BindingActivation<unknown>) => void;
method addDeactivation
addDeactivation: ( moduleId: ContainerModuleBase['id'], serviceIdentifier: ServiceIdentifier<unknown>, onDeactivation: interfaces.BindingDeactivation<unknown>) => void;
method remove
remove: (moduleId: ContainerModuleBase['id']) => ModuleActivationHandlers;
interface NextArgs
interface NextArgs<T = unknown> {}
property avoidConstraints
avoidConstraints: boolean;
property contextInterceptor
contextInterceptor: (contexts: Context) => Context;
property isMultiInject
isMultiInject: boolean;
property key
key?: string | number | symbol;
property serviceIdentifier
serviceIdentifier: interfaces.ServiceIdentifier<T>;
property targetType
targetType: TargetType;
property value
value?: unknown;
interface Plan
interface Plan {}
property parentContext
parentContext: Context;
property rootRequest
rootRequest: Request;
interface QueryableString
interface QueryableString {}
method contains
contains: (searchString: string) => boolean;
method endsWith
endsWith: (searchString: string) => boolean;
method equals
equals: (compareString: string) => boolean;
method startsWith
startsWith: (searchString: string) => boolean;
method value
value: () => string;
interface Request
interface Request {}
property bindings
bindings: Binding<unknown>[];
property childRequests
childRequests: Request[];
property id
id: number;
property parentContext
parentContext: Context;
property parentRequest
parentRequest: Request | null;
property requestScope
requestScope: RequestScope | null;
property serviceIdentifier
serviceIdentifier: ServiceIdentifier;
property target
target: Target;
method addChildRequest
addChildRequest: ( serviceIdentifier: ServiceIdentifier, bindings: Binding<unknown> | Binding<unknown>[], target: Target) => Request;
interface Target
interface Target {}
property id
id: number;
property identifier
identifier: string | symbol;
property metadata
metadata: Metadata[];
property name
name: QueryableString;
property serviceIdentifier
serviceIdentifier: ServiceIdentifier;
property type
type: TargetType;
method getCustomTags
getCustomTags: () => interfaces.Metadata[] | null;
method getNamedTag
getNamedTag: () => interfaces.Metadata<string> | null;
method hasTag
hasTag: (key: string | number | symbol) => boolean;
method isArray
isArray: () => boolean;
method isNamed
isNamed: () => boolean;
method isOptional
isOptional: () => boolean;
method isTagged
isTagged: () => boolean;
method matchesArray
matchesArray: (name: interfaces.ServiceIdentifier) => boolean;
method matchesNamedTag
matchesNamedTag: (name: string) => boolean;
method matchesTag
matchesTag: (key: string | number | symbol) => (value: unknown) => boolean;
interface TargetTypeEnum
interface TargetTypeEnum {}
property ClassProperty
ClassProperty: interfaces.TargetType;
property ConstructorArgument
ConstructorArgument: interfaces.TargetType;
property Variable
Variable: interfaces.TargetType;
type AsyncContainerModuleCallBack
type AsyncContainerModuleCallBack = AsyncCallback<ContainerModuleCallBack>;
type AutoFactory
type AutoFactory<T> = SimpleFactory<T, []>;
type AutoNamedFactory
type AutoNamedFactory<T> = SimpleFactory<T, [string]>;
type Bind
type Bind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
type BindingActivation
type BindingActivation<T> = ( context: interfaces.Context, injectable: T) => T | Promise<T>;
type BindingDeactivation
type BindingDeactivation<T> = (injectable: T) => void | Promise<void>;
type BindingScope
type BindingScope = 'Singleton' | 'Transient' | 'Request';
type BindingType
type BindingType = | 'ConstantValue' | 'Constructor' | 'DynamicValue' | 'Factory' | 'Function' | 'Instance' | 'Invalid' | 'Provider';
type ContainerModuleCallBack
type ContainerModuleCallBack = ( bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind, unbindAsync: interfaces.UnbindAsync, onActivation: interfaces.Container['onActivation'], onDeactivation: interfaces.Container['onDeactivation']) => void;
type ContainerResolution
type ContainerResolution<T> = T | Promise<T> | (T | Promise<T>)[];
type ContextInterceptor
type ContextInterceptor = (context: interfaces.Context) => interfaces.Context;
type DynamicValue
type DynamicValue<T> = (context: interfaces.Context) => T | Promise<T>;
type Factory
type Factory<T, U extends unknown[] = unknown[], V extends unknown[] = unknown[]> = | SimpleFactory<T, U> | MultiFactory<T, U, V>;
type FactoryCreator
type FactoryCreator< T, U extends unknown[] = unknown[], V extends unknown[] = unknown[]> = (context: Context) => Factory<T, U, V>;
type FactoryTypeFunction
type FactoryTypeFunction<T = unknown> = ( context: interfaces.Context) => T | Promise<T>;
type IsBound
type IsBound = <T>(serviceIdentifier: ServiceIdentifier<T>) => boolean;
type MetadataOrMetadataArray
type MetadataOrMetadataArray = Metadata | Metadata[];
type Middleware
type Middleware = (next: Next) => Next;
type MultiFactory
type MultiFactory< T, U extends unknown[] = unknown[], V extends unknown[] = unknown[]> = (...args: U) => SimpleFactory<T, V>;
type Newable
type Newable<T> = new (...args: never[]) => T;
type Next
type Next = (args: NextArgs) => any | any[];
type Provider
type Provider<T> = (...args: any[]) => ((...args: any[]) => Promise<T>) | Promise<T>;
type ProviderCreator
type ProviderCreator<T> = (context: Context) => Provider<T>;
type Rebind
type Rebind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
type RequestScope
type RequestScope = Map<unknown, unknown>;
type ResolveRequestHandler
type ResolveRequestHandler = (request: interfaces.Request) => unknown;
type ServiceIdentifier
type ServiceIdentifier<T = unknown> = string | symbol | Newable<T> | Abstract<T>;
type SimpleFactory
type SimpleFactory<T, U extends unknown[] = unknown[]> = (...args: U) => T;
type TargetType
type TargetType = 'ConstructorArgument' | 'ClassProperty' | 'Variable';
type Unbind
type Unbind = <T>(serviceIdentifier: ServiceIdentifier<T>) => void;
type UnbindAsync
type UnbindAsync = <T>(serviceIdentifier: ServiceIdentifier<T>) => Promise<void>;
Package Files (22)
- lib/annotation/decorator_utils.d.ts
- lib/annotation/inject.d.ts
- lib/annotation/injectable.d.ts
- lib/annotation/lazy_service_identifier.d.ts
- lib/annotation/multi_inject.d.ts
- lib/annotation/named.d.ts
- lib/annotation/optional.d.ts
- lib/annotation/post_construct.d.ts
- lib/annotation/pre_destroy.d.ts
- lib/annotation/tagged.d.ts
- lib/annotation/target_name.d.ts
- lib/annotation/unmanaged.d.ts
- lib/constants/literal_types.d.ts
- lib/container/container.d.ts
- lib/container/container_module.d.ts
- lib/interfaces/interfaces.d.ts
- lib/inversify.d.ts
- lib/planning/metadata_reader.d.ts
- lib/syntax/constraint_helpers.d.ts
- lib/utils/binding_utils.d.ts
- lib/utils/id.d.ts
- lib/utils/serialization.d.ts
Dependencies (0)
No dependencies.
Dev Dependencies (27)
- @types/chai
- @types/mocha
- @types/sinon
- browserify
- chai
- istanbul
- karma
- karma-chai
- karma-chrome-launcher
- karma-commonjs
- karma-es6-shim
- karma-firefox-launcher
- karma-ie-launcher
- karma-mocha
- karma-mocha-reporter
- karma-phantomjs-launcher
- karma-sinon
- mocha
- nyc
- publish-please
- reflect-metadata
- sinon
- ts-node
- tsify
- tslint
- typescript
- updates
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/inversify
.
- Markdown[](https://www.jsdocs.io/package/inversify)
- HTML<a href="https://www.jsdocs.io/package/inversify"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 5779 ms. - Missing or incorrect documentation? Open an issue for this package.