-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
35 lines (35 loc) · 1.3 KB
/
index.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
export declare function getDependencies(fn: Function): string[];
export declare enum LifeStyle {
Singleton = 0,
Transient = 1
}
export interface RegisterOptions {
lifeStyle: LifeStyle;
tags: string[];
dependsOn: {
[index: string]: any;
};
}
export interface UnregisterOptions {
tags: string[];
}
export declare function requireFacility(shelf: Container, name: string): any;
export declare function listFacility(shelf: Container, name: string): any[] | null;
export declare type Factory<T> = (dependencies?: any) => T;
export declare function factoryFacility(shelf: Container, name: string): ((dependencies?: any) => any) | null;
export declare type Facility = (shelf: Container, name: string) => any;
export declare class Container {
private components;
private facilities;
constructor();
resolveAll(name: string): any[];
resolve(name: string): any;
resolveNew(name: string, dependencies?: any): any;
register(name: string, component: any, options?: Partial<RegisterOptions>): void;
registerProperties(obj: any, options?: Partial<RegisterOptions>): void;
unregister(name?: string, options?: Partial<UnregisterOptions>): void;
use(facilityFunction: Facility): void;
private getComponents;
private resolveComponent;
private resolveNewComponent;
}