-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.d.ts
More file actions
70 lines (54 loc) · 1.9 KB
/
Copy pathapp.d.ts
File metadata and controls
70 lines (54 loc) · 1.9 KB
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
64
65
66
67
68
import {ConfigurationBase} from './config';
export declare abstract class IApplication {
/**
* Registers an application strategy e.g. an singleton service which to be used in application context
* @param {Function} serviceCtor
* @param {Function} strategyCtor
* @returns IApplication
*/
abstract useStrategy(serviceCtor: void, strategyCtor: void): this;
/**
* @param {Function} serviceCtor
* @returns {boolean}
*/
abstract hasStrategy(serviceCtor: void): boolean;
/**
* @param serviceCtor
*/
abstract getStrategy<T>(serviceCtor: new() => T): T;
/**
* Gets the configuration of this application
* @returns {ConfigurationBase}
*/
abstract getConfiguration(): ConfigurationBase;
}
export declare abstract class IApplicationService {
/**
* Gets the application of this service
* @returns {ApplicationBase}
*/
abstract getApplication(): ApplicationBase;
}
// tslint:disable-next-line:ban-types
export declare type ApplicationServiceConstructor<T> = Function & { prototype: T };
export declare interface ApplicationBase {
readonly configuration: ConfigurationBase;
useStrategy(serviceCtor: ApplicationServiceConstructor<any>, strategyCtor: ApplicationServiceConstructor<any>): this;
useService(serviceCtor: ApplicationServiceConstructor<any>): this;
hasService<T>(serviceCtor: ApplicationServiceConstructor<T>): boolean;
getService<T>(serviceCtor: ApplicationServiceConstructor<T>): T;
getConfiguration(): ConfigurationBase;
}
export declare class ApplicationService implements IApplicationService {
readonly application: ApplicationBase;
/**
* @constructor
* @param {ApplicationBase=} app
*/
constructor(app: ApplicationBase);
/**
* Gets the application of this service
* @returns {ApplicationBase}
*/
getApplication(): ApplicationBase;
}