inversify-dts
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -17,3 +17,3 @@ // Type definitions for inversify 1.0.0-beta.5 | ||
interface IProvideOnSyntax<T> extends IProvideDoneSyntax<T> { | ||
onActivation(fn: (context: inversify.IContext, injectable: T) => T): IProvideWhenSyntax<T>; | ||
onActivation(fn: (context: inversify.interfaces.Context, injectable: T) => T): IProvideWhenSyntax<T>; | ||
} | ||
@@ -26,3 +26,3 @@ | ||
interface IProvideWhenSyntax<T> extends IProvideDoneSyntax<T> { | ||
when(constraint: (request: inversify.IRequest) => boolean): IProvideOnSyntax<T>; | ||
when(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>; | ||
whenTargetNamed(name: string): IProvideOnSyntax<T>; | ||
@@ -39,13 +39,13 @@ whenTargetTagged(tag: string, value: any): IProvideOnSyntax<T>; | ||
whenNoAncestorTagged(tag: string, value: any): IProvideOnSyntax<T>; | ||
whenAnyAncestorMatches(constraint: (request: inversify.IRequest) => boolean): IProvideOnSyntax<T>; | ||
whenNoAncestorMatches(constraint: (request: inversify.IRequest) => boolean): IProvideOnSyntax<T>; | ||
whenAnyAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>; | ||
whenNoAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>; | ||
} | ||
export function autoProvide(kernel: inversify.IKernel, ...modules: any[]): void; | ||
export function autoProvide(kernel: inversify.interfaces.Kernel, ...modules: any[]): void; | ||
export function makeProvideDecorator(kernel: inversify.IKernel): | ||
(serviceIdentifier: (string|Symbol|inversify.INewable<any>)) => (target: any) => any; | ||
export function makeProvideDecorator(kernel: inversify.interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|inversify.interfaces.Newable<any>)) => (target: any) => any; | ||
export function makeFluentProvideDecorator(kernel: inversify.IKernel): | ||
(serviceIdentifier: (string|Symbol|inversify.INewable<any>)) => IProvideInWhenOnSyntax<any>; | ||
export function makeFluentProvideDecorator(kernel: inversify.interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|inversify.interfaces.Newable<any>)) => IProvideInWhenOnSyntax<any>; | ||
@@ -52,0 +52,0 @@ } |
@@ -20,2 +20,8 @@ /// <reference path="./inversify-express-utils.d.ts" /> | ||
}) | ||
.setErrorConfig((app) => { | ||
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => { | ||
console.error(err.stack); | ||
res.status(500).send("Something broke!"); | ||
}); | ||
}) | ||
.build() | ||
@@ -22,0 +28,0 @@ .listen(3000, "localhost"); |
@@ -1,2 +0,2 @@ | ||
// Type definitions for inversify 1.0.0-alpha.3 | ||
// Type definitions for inversify 1.0.0-alpha.4 | ||
// Project: https://github.com/inversify/inversify-express-utils | ||
@@ -13,3 +13,3 @@ // Definitions by: inversify <https://github.com/inversify/> | ||
interface IInversifyExpressServerConstructor { | ||
new(kernel: inversify.IKernel): IInversifyExpressServer; | ||
new(kernel: inversify.interfaces.Kernel): IInversifyExpressServer; | ||
} | ||
@@ -19,2 +19,3 @@ | ||
setConfig(fn: IConfigFunction): IInversifyExpressServer; | ||
setErrorConfig(fn: IConfigFunction): IInversifyExpressServer; | ||
build(): express.Application; | ||
@@ -35,2 +36,4 @@ } | ||
export interface IController {} | ||
export var InversifyExpressServer: IInversifyExpressServerConstructor; | ||
@@ -37,0 +40,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Type definitions for inversify 1.0.0-beta.5 | ||
// Type definitions for inversify 1.0.0-beta.6 | ||
// Project: https://github.com/inversify/inversify-logger-middleware | ||
@@ -45,3 +45,3 @@ // Definitions by: inversify <https://github.com/inversify/> | ||
results: any[]; | ||
rootRequest: inversify.IRequest; | ||
rootRequest: inversify.interfaces.Request; | ||
serviceIdentifier: any; | ||
@@ -52,3 +52,3 @@ target: any; | ||
export function makeLoggerMiddleware(settings?: ILoggerSettings, renderer?: (out: ILogEntry) => void): inversify.IMiddleware; | ||
export function makeLoggerMiddleware(settings?: ILoggerSettings, renderer?: (out: ILogEntry) => void): inversify.interfaces.Middleware; | ||
export function textSerializer(entry: ILogEntry): string; | ||
@@ -55,0 +55,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Type definitions for inversify 2.0.0-beta.8 | ||
// Type definitions for inversify 2.0.0-beta.9 | ||
// Project: https://github.com/inversify/InversifyJS | ||
@@ -19,163 +19,227 @@ // Definitions by: inversify <https://github.com/inversify> | ||
export interface IKernelConstructor { | ||
new(): IKernel; | ||
} | ||
namespace interfaces { | ||
export interface PlanAndResolve<T> { | ||
(args: PlanAndResolveArgs): T[]; | ||
} | ||
export interface KernelConstructor { | ||
new(): Kernel; | ||
} | ||
export interface IMiddleware extends Function { | ||
(next: PlanAndResolve<any>): PlanAndResolve<any>; | ||
} | ||
export interface KernelModuleConstructor { | ||
new(registry: (bind: Bind) => void): KernelModule; | ||
} | ||
export interface PlanAndResolveArgs { | ||
multiInject: boolean; | ||
serviceIdentifier: (string|Symbol|INewable<any>); | ||
target: ITarget; | ||
contextInterceptor: (contexts: IContext) => IContext; | ||
} | ||
export interface Newable<T> { | ||
new(...args: any[]): T; | ||
} | ||
export interface IKernel { | ||
bind<T>(serviceIdentifier: (string|Symbol|INewable<T>)): IBindingToSyntax<T>; | ||
unbind(serviceIdentifier: (string|Symbol|any)): void; | ||
unbindAll(): void; | ||
get<T>(serviceIdentifier: (string|Symbol|INewable<T>)): T; | ||
getNamed<T>(serviceIdentifier: (string|Symbol|INewable<T>), named: string): T; | ||
getTagged<T>(serviceIdentifier: (string|Symbol|INewable<T>), key: string, value: any): T; | ||
getAll<T>(serviceIdentifier: (string|Symbol|INewable<T>)): T[]; | ||
load(...modules: IKernelModule[]): void; | ||
applyMiddleware(...middleware: IMiddleware[]): void; | ||
getServiceIdentifierAsString(serviceIdentifier: (string|Symbol|INewable<any>)): string; | ||
snapshot(): void; | ||
restore(): void; | ||
} | ||
export type ServiceIdentifier<T> = (string|Symbol|Newable<T>); | ||
export interface IKernelModule extends Function { | ||
(kernel: IKernel): void; | ||
} | ||
export interface Binding<T> extends Clonable<Binding<T>> { | ||
guid: string; | ||
moduleId: string; | ||
activated: boolean; | ||
serviceIdentifier: ServiceIdentifier<T>; | ||
implementationType: Newable<T>; | ||
factory: FactoryCreator<any>; | ||
provider: ProviderCreator<any>; | ||
constraint: (request: Request) => boolean; | ||
onActivation: (context: Context, injectable: T) => T; | ||
cache: T; | ||
dynamicValue: () => T; | ||
scope: number; // BindingScope | ||
type: number; // BindingType | ||
} | ||
interface IBindingOnSyntax<T> { | ||
onActivation(fn: (context: IContext, injectable: T) => T): IBindingWhenSyntax<T>; | ||
} | ||
export interface Factory<T> extends Function { | ||
(...args: any[]): (((...args: any[]) => T)|T); | ||
} | ||
interface IBindingInSyntax<T> { | ||
inSingletonScope(): IBindingWhenOnSyntax<T>; | ||
} | ||
export interface FactoryCreator<T> extends Function { | ||
(context: Context): Factory<T>; | ||
} | ||
interface IBindingWhenSyntax<T> { | ||
when(constraint: (request: IRequest) => boolean): IBindingOnSyntax<T>; | ||
whenTargetNamed(name: string): IBindingOnSyntax<T>; | ||
whenTargetTagged(tag: string, value: any): IBindingOnSyntax<T>; | ||
whenInjectedInto(parent: (Function|string)): IBindingOnSyntax<T>; | ||
whenParentNamed(name: string): IBindingOnSyntax<T>; | ||
whenParentTagged(tag: string, value: any): IBindingOnSyntax<T>; | ||
whenAnyAncestorIs(ancestor: (Function|string)): IBindingOnSyntax<T>; | ||
whenNoAncestorIs(ancestor: (Function|string)): IBindingOnSyntax<T>; | ||
whenAnyAncestorNamed(name: string): IBindingOnSyntax<T>; | ||
whenAnyAncestorTagged(tag: string, value: any): IBindingOnSyntax<T>; | ||
whenNoAncestorNamed(name: string): IBindingOnSyntax<T>; | ||
whenNoAncestorTagged(tag: string, value: any): IBindingOnSyntax<T>; | ||
whenAnyAncestorMatches(constraint: (request: IRequest) => boolean): IBindingOnSyntax<T>; | ||
whenNoAncestorMatches(constraint: (request: IRequest) => boolean): IBindingOnSyntax<T>; | ||
} | ||
export interface Provider<T> extends Function { | ||
(): Promise<T>; | ||
} | ||
interface IBindingToSyntax<T> { | ||
to(constructor: { new(...args: any[]): T; }): IBindingInWhenOnSyntax<T>; | ||
toConstantValue(value: T): IBindingWhenOnSyntax<T>; | ||
toDynamicValue(func: () => T): IBindingWhenOnSyntax<T>; | ||
toConstructor<T2>(constructor: INewable<T2>): IBindingWhenOnSyntax<T>; | ||
toFactory<T2>(factory: IFactoryCreator<T2>): IBindingWhenOnSyntax<T>; | ||
toAutoFactory<T2>(serviceIdentifier: (string|Symbol|T2)): IBindingWhenOnSyntax<T>; | ||
toProvider<T2>(provider: IProviderCreator<T2>): IBindingWhenOnSyntax<T>; | ||
} | ||
export interface ProviderCreator<T> extends Function { | ||
(context: Context): Provider<T>; | ||
} | ||
interface IBindingInWhenOnSyntax<T> extends IBindingInSyntax<T>, IBindingWhenOnSyntax<T> {} | ||
interface IBindingWhenOnSyntax<T> extends IBindingWhenSyntax<T>, IBindingOnSyntax<T> {} | ||
export interface PlanAndResolve<T> { | ||
(args: PlanAndResolveArgs): T[]; | ||
} | ||
export interface IFactory<T> extends Function { | ||
(...args: any[]): (((...args: any[]) => T)|T); | ||
} | ||
export interface PlanAndResolveArgs { | ||
multiInject: boolean; | ||
serviceIdentifier: (string|Symbol|Newable<any>); | ||
target: Target; | ||
contextInterceptor: (contexts: Context) => Context; | ||
} | ||
interface IFactoryCreator<T> extends Function { | ||
(context: IContext): IFactory<T>; | ||
} | ||
export interface Middleware extends Function { | ||
(next: PlanAndResolve<any>): PlanAndResolve<any>; | ||
} | ||
export interface INewable<T> { | ||
new(...args: any[]): T; | ||
} | ||
export interface Context { | ||
guid: string; | ||
kernel: Kernel; | ||
plan: Plan; | ||
addPlan(plan: Plan): void; | ||
} | ||
export interface IProvider<T> extends Function { | ||
(): Promise<T>; | ||
} | ||
export interface ReflectResult { | ||
[key: string]: Metadata[]; | ||
} | ||
interface IProviderCreator<T> extends Function { | ||
(context: IContext): IProvider<T>; | ||
} | ||
export interface Metadata { | ||
key: string; | ||
value: any; | ||
} | ||
export interface IContext { | ||
kernel: IKernel; | ||
plan: IPlan; | ||
addPlan(plan: IPlan): void; | ||
} | ||
export interface Plan { | ||
parentContext: Context; | ||
rootRequest: Request; | ||
} | ||
export interface IPlan { | ||
parentContext: IContext; | ||
rootRequest: IRequest; | ||
} | ||
export interface Planner { | ||
createContext(kernel: Kernel): Context; | ||
createPlan(parentContext: Context, binding: Binding<any>, target: Target): Plan; | ||
getBindings<T>(kernel: Kernel, serviceIdentifier: ServiceIdentifier<T>): Binding<T>[]; | ||
getActiveBindings(parentRequest: Request, target: Target): Binding<any>[]; | ||
} | ||
export interface IRequest { | ||
serviceIdentifier: (string|Symbol|INewable<any>); | ||
parentContext: IContext; | ||
parentRequest: IRequest; | ||
childRequests: IRequest[]; | ||
target: ITarget; | ||
bindings: IBinding<any>[]; | ||
addChildRequest( | ||
serviceIdentifier: (string|Symbol|INewable<any>), | ||
bindings: (IBinding<any>|IBinding<any>[]), | ||
target: ITarget): IRequest; | ||
} | ||
export interface QueryableString { | ||
startsWith(searchString: string): boolean; | ||
endsWith(searchString: string): boolean; | ||
contains(searchString: string): boolean; | ||
equals(compareString: string): boolean; | ||
value(): string; | ||
} | ||
export interface IBinding<T> { | ||
activated: boolean; | ||
serviceIdentifier: (string|Symbol|INewable<T>); | ||
implementationType: INewable<T>; | ||
factory: IFactoryCreator<any>; | ||
provider: IProviderCreator<any>; | ||
constraint: (request: IRequest) => boolean; | ||
onActivation: (context: IContext, injectable: T) => T; | ||
cache: T; | ||
dynamicValue: () => T; | ||
scope: number; // BindingScope | ||
type: number; // BindingType | ||
} | ||
export interface Request { | ||
guid: string; | ||
serviceIdentifier: (string|Symbol|Newable<any>); | ||
parentContext: Context; | ||
parentRequest: Request; | ||
childRequests: Request[]; | ||
target: Target; | ||
bindings: Binding<any>[]; | ||
addChildRequest( | ||
serviceIdentifier: (string|Symbol|Newable<any>), | ||
bindings: (Binding<any>|Binding<any>[]), | ||
target: Target | ||
): Request; | ||
} | ||
export interface ITarget { | ||
serviceIdentifier: (string|Symbol|INewable<any>); | ||
name: IQueryableString; | ||
metadata: Array<IMetadata>; | ||
hasTag(key: string): boolean; | ||
isArray(): boolean; | ||
matchesArray(name: string|Symbol|any): boolean; | ||
isNamed(): boolean; | ||
isTagged(): boolean; | ||
matchesNamedTag(name: string): boolean; | ||
matchesTag(key: string): (value: any) => boolean; | ||
} | ||
export interface Target { | ||
guid: string; | ||
serviceIdentifier: (string|Symbol|Newable<any>); | ||
name: QueryableString; | ||
metadata: Array<Metadata>; | ||
hasTag(key: string): boolean; | ||
isArray(): boolean; | ||
matchesArray(name: string|Symbol|any): boolean; | ||
isNamed(): boolean; | ||
isTagged(): boolean; | ||
matchesNamedTag(name: string): boolean; | ||
matchesTag(key: string): (value: any) => boolean; | ||
} | ||
export interface IQueryableString { | ||
startsWith(searchString: string): boolean; | ||
endsWith(searchString: string): boolean; | ||
contains(searchString: string): boolean; | ||
equals(compareString: string): boolean; | ||
value(): string; | ||
} | ||
export interface Resolver { | ||
resolve<T>(context: Context): T; | ||
} | ||
export interface IMetadata { | ||
key: string; | ||
value: any; | ||
export interface Kernel { | ||
guid: string; | ||
bind<T>(serviceIdentifier: ServiceIdentifier<T>): BindingToSyntax<T>; | ||
unbind(serviceIdentifier: ServiceIdentifier<any>): void; | ||
unbindAll(): void; | ||
isBound(serviceIdentifier: ServiceIdentifier<any>): boolean; | ||
get<T>(serviceIdentifier: ServiceIdentifier<T>): T; | ||
getNamed<T>(serviceIdentifier: ServiceIdentifier<T>, named: string): T; | ||
getTagged<T>(serviceIdentifier: ServiceIdentifier<T>, key: string, value: any): T; | ||
getAll<T>(serviceIdentifier: ServiceIdentifier<T>): T[]; | ||
load(...modules: KernelModule[]): void; | ||
unload(...modules: KernelModule[]): void; | ||
applyMiddleware(...middleware: Middleware[]): void; | ||
getServiceIdentifierAsString(serviceIdentifier: ServiceIdentifier<any>): string; | ||
snapshot(): void; | ||
restore(): void; | ||
} | ||
export interface Bind extends Function { | ||
<T>(serviceIdentifier: ServiceIdentifier<T>): BindingToSyntax<T>; | ||
} | ||
export interface KernelModule { | ||
guid: string; | ||
registry: (bind: Bind) => void; | ||
} | ||
export interface KernelSnapshot { | ||
bindings: Lookup<Binding<any>>; | ||
middleware: PlanAndResolve<any>; | ||
} | ||
export interface Clonable<T> { | ||
clone(): T; | ||
} | ||
export interface Lookup<T> extends Clonable<Lookup<T>> { | ||
add(serviceIdentifier: (string|Symbol|any), value: T): void; | ||
get(serviceIdentifier: (string|Symbol|any)): Array<T>; | ||
remove(serviceIdentifier: (string|Symbol|any)): void; | ||
removeByModuleId(moduleId: string): void; | ||
hasKey(serviceIdentifier: (string|Symbol|any)): boolean; | ||
} | ||
export interface KeyValuePair<T> { | ||
serviceIdentifier: (string|Symbol|any); | ||
value: Array<T>; | ||
} | ||
export interface BindingInSyntax<T> { | ||
inSingletonScope(): BindingWhenOnSyntax<T>; | ||
} | ||
export interface BindingInWhenOnSyntax<T> extends BindingInSyntax<T>, BindingWhenOnSyntax<T> {} | ||
export interface BindingOnSyntax<T> { | ||
onActivation(fn: (context: Context, injectable: T) => T): BindingWhenSyntax<T>; | ||
} | ||
export interface BindingToSyntax<T> { | ||
to(constructor: { new(...args: any[]): T; }): BindingInWhenOnSyntax<T>; | ||
toConstantValue(value: T): BindingWhenOnSyntax<T>; | ||
toDynamicValue(func: () => T): BindingWhenOnSyntax<T>; | ||
toConstructor<T2>(constructor: Newable<T2>): BindingWhenOnSyntax<T>; | ||
toFactory<T2>(factory: FactoryCreator<T2>): BindingWhenOnSyntax<T>; | ||
toFunction(func: T): BindingWhenOnSyntax<T>; | ||
toAutoFactory<T2>(serviceIdentifier: (string|Symbol|Newable<T2>)): BindingWhenOnSyntax<T>; | ||
toProvider<T2>(provider: ProviderCreator<T2>): BindingWhenOnSyntax<T>; | ||
} | ||
export interface BindingWhenOnSyntax<T> extends BindingWhenSyntax<T>, BindingOnSyntax<T> {} | ||
export interface BindingWhenSyntax<T> { | ||
when(constraint: (request: Request) => boolean): BindingOnSyntax<T>; | ||
whenTargetNamed(name: string): BindingOnSyntax<T>; | ||
whenTargetTagged(tag: string, value: any): BindingOnSyntax<T>; | ||
whenInjectedInto(parent: (Function|string)): BindingOnSyntax<T>; | ||
whenParentNamed(name: string): BindingOnSyntax<T>; | ||
whenParentTagged(tag: string, value: any): BindingOnSyntax<T>; | ||
whenAnyAncestorIs(ancestor: (Function|string)): BindingOnSyntax<T>; | ||
whenNoAncestorIs(ancestor: (Function|string)): BindingOnSyntax<T>; | ||
whenAnyAncestorNamed(name: string): BindingOnSyntax<T>; | ||
whenAnyAncestorTagged(tag: string, value: any): BindingOnSyntax<T>; | ||
whenNoAncestorNamed(name: string): BindingOnSyntax<T>; | ||
whenNoAncestorTagged(tag: string, value: any): BindingOnSyntax<T>; | ||
whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>; | ||
whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>; | ||
} | ||
} | ||
export var Kernel: IKernelConstructor; | ||
export var Kernel: interfaces.KernelConstructor; | ||
export var KernelModule: interfaces.KernelModuleConstructor; | ||
export var decorate: (decorator: (ClassDecorator|ParameterDecorator), target: any, parameterIndex?: number) => void; | ||
@@ -189,19 +253,19 @@ export function injectable(): (typeConstructor: any) => void; | ||
export function makePropertyInjectDecorator(kernel: IKernel): | ||
(serviceIdentifier: (string|Symbol|INewable<any>)) => (proto: any, key: string) => void; | ||
export function makePropertyInjectDecorator(kernel: interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|interfaces.Newable<any>)) => (proto: any, key: string) => void; | ||
export function makePropertyInjectNamedDecorator(kernel: IKernel): | ||
(serviceIdentifier: (string|Symbol|INewable<any>), named: string) => (proto: any, key: string) => void; | ||
export function makePropertyInjectNamedDecorator(kernel: interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|interfaces.Newable<any>), named: string) => (proto: any, key: string) => void; | ||
export function makePropertyInjectTaggedDecorator(kernel: IKernel): | ||
(serviceIdentifier: (string|Symbol|INewable<any>), key: string, value: any) => (proto: any, propertyName: string) => void; | ||
export function makePropertyInjectTaggedDecorator(kernel: interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|interfaces.Newable<any>), key: string, value: any) => (proto: any, propertyName: string) => void; | ||
export function makePropertyMultiInjectDecorator(kernel: IKernel): | ||
(serviceIdentifier: (string|Symbol|INewable<any>)) => (proto: any, key: string) => void; | ||
export function makePropertyMultiInjectDecorator(kernel: interfaces.Kernel): | ||
(serviceIdentifier: (string|Symbol|interfaces.Newable<any>)) => (proto: any, key: string) => void; | ||
// constraint helpers | ||
export var traverseAncerstors: (request: IRequest, constraint: (request: IRequest) => boolean) => boolean; | ||
export var taggedConstraint: (tag: string) => (value: any) => (request: IRequest) => boolean; | ||
export var namedConstraint: (value: any) => (request: IRequest) => boolean; | ||
export var typeConstraint: (type: (Function|string)) => (request: IRequest) => boolean; | ||
export var traverseAncerstors: (request: interfaces.Request, constraint: (request: interfaces.Request) => boolean) => boolean; | ||
export var taggedConstraint: (tag: string) => (value: any) => (request: interfaces.Request) => boolean; | ||
export var namedConstraint: (value: any) => (request: interfaces.Request) => boolean; | ||
export var typeConstraint: (type: (Function|string)) => (request: interfaces.Request) => boolean; | ||
} | ||
@@ -208,0 +272,0 @@ |
{ | ||
"name": "inversify-dts", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "The InversifyJS TypeScript type definitions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
26173
419