-
Notifications
You must be signed in to change notification settings - Fork 0
/
forge-di-smithy.d.ts
63 lines (62 loc) · 1.85 KB
/
forge-di-smithy.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
declare module 'forge-di-smithy/index' {
/// <reference path="../typings/tsd.d.ts" />
import Forge = require('forge-di'); module Smithy {
interface IBlacksmith {
forge: Forge;
registerEquipment(equipment: IEquipment): IBlacksmith;
}
interface IEquipment extends Array<ITool<any>> {
}
interface ITool<T> {
name: string;
target: T;
targetType?: TargetType;
lifecycle?: Lifecycle;
when?: Forge.IPredicate;
hint?: string;
bindingArguments?: Forge.IBindingArguments;
}
enum Lifecycle {
Singleton = 0,
Transient = 1,
}
enum TargetType {
Type = 0,
Instance = 1,
Function = 2,
}
class Blacksmith implements IBlacksmith {
forge: Forge;
constructor(forge: Forge);
registerEquipment(equipment: IEquipment): IBlacksmith;
}
module Tools {
class BaseTool<T> implements ITool<T> {
name: string;
target: T;
targetType: TargetType;
lifecycle: Lifecycle;
when: Forge.IPredicate;
hint: string;
bindingArguments: Forge.IBindingArguments;
constructor(options: ITool<T>);
}
class Function<T extends {
(...args: any[]): any;
}> extends BaseTool<T> implements ITool<T> {
constructor(options: ITool<T>);
}
class Instance<T extends Object> extends BaseTool<T> implements ITool<T> {
constructor(options: ITool<T>);
}
class Type<T extends Forge.IType> extends BaseTool<T> implements ITool<T> {
constructor(options: ITool<T>);
}
}
}
export = Smithy;
}
declare module 'forge-di-smithy' {
import main = require('forge-di-smithy/index');
export = main;
}