UNPKG

1.55 kBTypeScriptView Raw
1import {ConfigurationBase} from "./config";
2
3export declare interface IApplication {
4 /**
5 * @constructor
6 * @param {string=} configPath
7 */
8 constructor(configPath?: string);
9 /**
10 * Registers an application strategy e.g. an singleton service which to be used in application contextr
11 * @param {Function} serviceCtor
12 * @param {Function} strategyCtor
13 * @returns IApplication
14 */
15 useStrategy(serviceCtor: any, strategyCtor: any): IApplication;
16 /**
17 * @param {Function} serviceCtor
18 * @returns {boolean}
19 */
20 hasStrategy(serviceCtor: any): boolean;
21 /**
22 * Gets an application strategy based on the given base service type
23 * @param {Function} serviceCtor
24 * @return {*}
25 */
26 getStrategy(serviceCtor: any): IApplicationService;
27
28 /**
29 * Gets the configuration of this application
30 * @returns {ConfigurationBase}
31 */
32 getConfiguration():ConfigurationBase;
33}
34
35export declare interface IApplicationService {
36 /**
37 * @constructor
38 * @param {IApplication=} app
39 */
40 constructor(app: IApplication);
41 /**
42 * Gets the application of this service
43 * @returns {IApplication}
44 */
45 getApplication():IApplication;
46}
47
48export declare class ApplicationService implements IApplicationService {
49 /**
50 * @constructor
51 * @param {IApplication=} app
52 */
53 constructor(app: IApplication);
54 /**
55 * Gets the application of this service
56 * @returns {IApplication}
57 */
58 getApplication():IApplication;
59}
\No newline at end of file