@alterior/runtime 3.13.3 → 3.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/app-options.d.ts +65 -65
  2. package/dist/app-options.js +26 -26
  3. package/dist/app-options.js.map +1 -1
  4. package/dist/application.d.ts +52 -52
  5. package/dist/application.js +172 -171
  6. package/dist/application.js.map +1 -1
  7. package/dist/args.d.ts +7 -7
  8. package/dist/args.js +13 -13
  9. package/dist/expose.d.ts +12 -12
  10. package/dist/expose.d.ts.map +1 -1
  11. package/dist/expose.js +36 -36
  12. package/dist/expose.js.map +1 -1
  13. package/dist/index.d.ts +9 -9
  14. package/dist/index.js +12 -12
  15. package/dist/lifecycle.d.ts +24 -24
  16. package/dist/lifecycle.js +2 -2
  17. package/dist/module.test.d.ts +1 -1
  18. package/dist/modules.d.ts +120 -120
  19. package/dist/modules.js +282 -282
  20. package/dist/modules.js.map +1 -1
  21. package/dist/reflector.d.ts +123 -123
  22. package/dist/reflector.js +306 -306
  23. package/dist/reflector.js.map +1 -1
  24. package/dist/roles.service.d.ts +79 -79
  25. package/dist/roles.service.js +124 -124
  26. package/dist/roles.service.js.map +1 -1
  27. package/dist/service.d.ts +24 -24
  28. package/dist/service.js +19 -19
  29. package/dist/service.js.map +1 -1
  30. package/dist/test.d.ts +1 -1
  31. package/dist.esm/app-options.d.ts +65 -65
  32. package/dist.esm/app-options.js +23 -23
  33. package/dist.esm/app-options.js.map +1 -1
  34. package/dist.esm/application.d.ts +52 -52
  35. package/dist.esm/application.js +167 -166
  36. package/dist.esm/application.js.map +1 -1
  37. package/dist.esm/args.d.ts +7 -7
  38. package/dist.esm/args.js +9 -9
  39. package/dist.esm/expose.d.ts +12 -12
  40. package/dist.esm/expose.d.ts.map +1 -1
  41. package/dist.esm/expose.js +31 -31
  42. package/dist.esm/expose.js.map +1 -1
  43. package/dist.esm/index.d.ts +9 -9
  44. package/dist.esm/index.js +9 -9
  45. package/dist.esm/lifecycle.d.ts +24 -24
  46. package/dist.esm/lifecycle.js +1 -1
  47. package/dist.esm/module.test.d.ts +1 -1
  48. package/dist.esm/modules.d.ts +120 -120
  49. package/dist.esm/modules.js +276 -276
  50. package/dist.esm/modules.js.map +1 -1
  51. package/dist.esm/reflector.d.ts +123 -123
  52. package/dist.esm/reflector.js +296 -296
  53. package/dist.esm/reflector.js.map +1 -1
  54. package/dist.esm/roles.service.d.ts +79 -79
  55. package/dist.esm/roles.service.js +121 -121
  56. package/dist.esm/roles.service.js.map +1 -1
  57. package/dist.esm/service.d.ts +24 -24
  58. package/dist.esm/service.js +15 -15
  59. package/dist.esm/service.js.map +1 -1
  60. package/dist.esm/test.d.ts +1 -1
  61. package/package.json +9 -9
  62. package/src/application.ts +1 -1
  63. package/tsconfig.esm.tsbuildinfo +1 -0
  64. package/tsconfig.json +0 -2
  65. package/tsconfig.tsbuildinfo +1 -5546
@@ -1,8 +1,8 @@
1
- /**
2
- * Abstracts the fetching of the application's arguments. This is most useful for testing,
3
- * but could also be used if trying to host Alterior in a strange environment.
4
- */
5
- export declare class ApplicationArgs {
6
- get(): string[];
7
- }
1
+ /**
2
+ * Abstracts the fetching of the application's arguments. This is most useful for testing,
3
+ * but could also be used if trying to host Alterior in a strange environment.
4
+ */
5
+ export declare class ApplicationArgs {
6
+ get(): string[];
7
+ }
8
8
  //# sourceMappingURL=args.d.ts.map
package/dist.esm/args.js CHANGED
@@ -1,10 +1,10 @@
1
- /**
2
- * Abstracts the fetching of the application's arguments. This is most useful for testing,
3
- * but could also be used if trying to host Alterior in a strange environment.
4
- */
5
- export class ApplicationArgs {
6
- get() {
7
- return process.argv.slice(2);
8
- }
9
- }
1
+ /**
2
+ * Abstracts the fetching of the application's arguments. This is most useful for testing,
3
+ * but could also be used if trying to host Alterior in a strange environment.
4
+ */
5
+ export class ApplicationArgs {
6
+ get() {
7
+ return process.argv.slice(2);
8
+ }
9
+ }
10
10
  //# sourceMappingURL=args.js.map
@@ -1,13 +1,13 @@
1
- export interface ExposeOptions {
2
- }
3
- export interface Exposure {
4
- propertyName: string;
5
- }
6
- export declare const EXPOSURES_PROPERTY = "alterior:service:exposures";
7
- export declare function Expose(): (target: Object, propertyName: string, descriptor: PropertyDescriptor) => void;
8
- export declare class ExposureReflector {
9
- constructor(type: Function);
10
- private getExposuresFromType;
11
- exposures: Exposure[];
12
- }
1
+ export interface ExposeOptions {
2
+ }
3
+ export interface Exposure {
4
+ propertyName: string;
5
+ }
6
+ export declare const EXPOSURES_PROPERTY = "alterior:service:exposures";
7
+ export declare function Expose(): (target: Object, propertyName: string, descriptor: PropertyDescriptor) => void;
8
+ export declare class ExposureReflector {
9
+ constructor(type: Function);
10
+ private getExposuresFromType;
11
+ exposures: Exposure[];
12
+ }
13
13
  //# sourceMappingURL=expose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expose.d.ts","sourceRoot":"","sources":["../src/expose.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;CAE7B;AAED,MAAM,WAAW,QAAQ;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D,wBAAgB,MAAM,aACO,MAAM,gBAAgB,MAAM,cAAc,kBAAkB,UAaxF;AAGD,qBAAa,iBAAiB;gBACjB,IAAI,EAAG,QAAQ;IAI3B,OAAO,CAAC,oBAAoB;IAUrB,SAAS,EAAG,QAAQ,EAAE,CAAC;CAC9B"}
1
+ {"version":3,"file":"expose.d.ts","sourceRoot":"","sources":["../src/expose.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;CAE7B;AAED,MAAM,WAAW,QAAQ;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D,wBAAgB,MAAM,KACD,QAAQ,MAAM,EAAE,cAAc,MAAM,EAAE,YAAY,kBAAkB,UAaxF;AAGD,qBAAa,iBAAiB;gBACjB,IAAI,EAAG,QAAQ;IAI3B,OAAO,CAAC,oBAAoB;IAUrB,SAAS,EAAG,QAAQ,EAAE,CAAC;CAC9B"}
@@ -1,32 +1,32 @@
1
- import { shallowClone } from '@alterior/common';
2
- export const EXPOSURES_PROPERTY = 'alterior:service:exposures';
3
- export function Expose() {
4
- return function (target, propertyName, descriptor) {
5
- if (!target.hasOwnProperty(EXPOSURES_PROPERTY)) {
6
- Object.defineProperty(target, EXPOSURES_PROPERTY, {
7
- enumerable: false,
8
- value: []
9
- });
10
- }
11
- let routes = target[EXPOSURES_PROPERTY] || [];
12
- routes.push({
13
- propertyName
14
- });
15
- };
16
- }
17
- export class ExposureReflector {
18
- constructor(type) {
19
- this.exposures = this.getExposuresFromType(type).map(x => shallowClone(x));
20
- }
21
- getExposuresFromType(type) {
22
- let parentPrototype = Object.getPrototypeOf(type.prototype);
23
- let exposures = (type.prototype[EXPOSURES_PROPERTY] || []);
24
- if (parentPrototype) {
25
- return [].concat(...this.getExposuresFromType(parentPrototype.constructor), ...exposures);
26
- }
27
- else {
28
- return [].concat(...exposures);
29
- }
30
- }
31
- }
1
+ import { shallowClone } from '@alterior/common';
2
+ export const EXPOSURES_PROPERTY = 'alterior:service:exposures';
3
+ export function Expose() {
4
+ return function (target, propertyName, descriptor) {
5
+ if (!target.hasOwnProperty(EXPOSURES_PROPERTY)) {
6
+ Object.defineProperty(target, EXPOSURES_PROPERTY, {
7
+ enumerable: false,
8
+ value: []
9
+ });
10
+ }
11
+ let routes = target[EXPOSURES_PROPERTY] || [];
12
+ routes.push({
13
+ propertyName
14
+ });
15
+ };
16
+ }
17
+ export class ExposureReflector {
18
+ constructor(type) {
19
+ this.exposures = this.getExposuresFromType(type).map(x => shallowClone(x));
20
+ }
21
+ getExposuresFromType(type) {
22
+ let parentPrototype = Object.getPrototypeOf(type.prototype);
23
+ let exposures = (type.prototype[EXPOSURES_PROPERTY] || []);
24
+ if (parentPrototype) {
25
+ return [].concat(...this.getExposuresFromType(parentPrototype.constructor), ...exposures);
26
+ }
27
+ else {
28
+ return [].concat(...exposures);
29
+ }
30
+ }
31
+ }
32
32
  //# sourceMappingURL=expose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expose.js","sourceRoot":"","sources":["../src/expose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D,MAAM,UAAU,MAAM;IAClB,OAAO,UAAU,MAAc,EAAE,YAAoB,EAAE,UAA8B;QACvF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;YAC/C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,kBAAkB,EAAE;gBACjD,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,EAAE;aACT,CAAC,CAAC;SACH;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAW;YACrB,YAAY;SACZ,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAGD,MAAM,OAAO,iBAAiB;IAC7B,YAAY,IAAe;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEO,oBAAoB,CAAC,IAAe;QAC3C,IAAI,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,SAAS,GAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,IAAI,eAAe,EAAE;YACpB,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;SAC1F;aAAM;YACN,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;SAC/B;IACF,CAAC;CAGD"}
1
+ {"version":3,"file":"expose.js","sourceRoot":"","sources":["../src/expose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D,MAAM,UAAU,MAAM;IAClB,OAAO,UAAU,MAAc,EAAE,YAAoB,EAAE,UAA8B;QACvF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,kBAAkB,EAAE;gBACjD,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,EAAE;aACT,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAW;YACrB,YAAY;SACZ,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAGD,MAAM,OAAO,iBAAiB;IAC7B,YAAY,IAAe;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEO,oBAAoB,CAAC,IAAe;QAC3C,IAAI,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,SAAS,GAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,IAAI,eAAe,EAAE,CAAC;YACrB,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;QAC3F,CAAC;aAAM,CAAC;YACP,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;CAGD"}
@@ -1,10 +1,10 @@
1
- export * from './app-options';
2
- export * from './lifecycle';
3
- export * from './args';
4
- export * from './application';
5
- export * from './modules';
6
- export * from './reflector';
7
- export * from './roles.service';
8
- export * from './service';
9
- export * from './expose';
1
+ export * from './app-options';
2
+ export * from './lifecycle';
3
+ export * from './args';
4
+ export * from './application';
5
+ export * from './modules';
6
+ export * from './reflector';
7
+ export * from './roles.service';
8
+ export * from './service';
9
+ export * from './expose';
10
10
  //# sourceMappingURL=index.d.ts.map
package/dist.esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
- export * from './app-options';
2
- export * from './lifecycle';
3
- export * from './args';
4
- export * from './application';
5
- export * from './modules';
6
- export * from './reflector';
7
- export * from './roles.service';
8
- export * from './service';
9
- export * from './expose';
1
+ export * from './app-options';
2
+ export * from './lifecycle';
3
+ export * from './args';
4
+ export * from './application';
5
+ export * from './modules';
6
+ export * from './reflector';
7
+ export * from './roles.service';
8
+ export * from './service';
9
+ export * from './expose';
10
10
  //# sourceMappingURL=index.js.map
@@ -1,25 +1,25 @@
1
- /**
2
- * Specifies that the implementer understands the Alterior OnInit lifecycle event.
3
- * Implementing this interface is a best practice to ensure that implementations
4
- * are well-formed.
5
- */
6
- export interface OnInit {
7
- altOnInit(): any;
8
- }
9
- /**
10
- * Specifies that the implementer understands the Alterior OnStart lifecycle event.
11
- * Implementing this interface is a best practice to ensure that implementations
12
- * are well-formed.
13
- */
14
- export interface OnStart {
15
- altOnStart(): any;
16
- }
17
- /**
18
- * Specifies that the implementer understands the Alterior OnStop lifecycle event.
19
- * Implementing this interface is a best practice to ensure that implementations
20
- * are well-formed.
21
- */
22
- export interface OnStop {
23
- altOnStop(): any;
24
- }
1
+ /**
2
+ * Specifies that the implementer understands the Alterior OnInit lifecycle event.
3
+ * Implementing this interface is a best practice to ensure that implementations
4
+ * are well-formed.
5
+ */
6
+ export interface OnInit {
7
+ altOnInit(): any;
8
+ }
9
+ /**
10
+ * Specifies that the implementer understands the Alterior OnStart lifecycle event.
11
+ * Implementing this interface is a best practice to ensure that implementations
12
+ * are well-formed.
13
+ */
14
+ export interface OnStart {
15
+ altOnStart(): any;
16
+ }
17
+ /**
18
+ * Specifies that the implementer understands the Alterior OnStop lifecycle event.
19
+ * Implementing this interface is a best practice to ensure that implementations
20
+ * are well-formed.
21
+ */
22
+ export interface OnStop {
23
+ altOnStop(): any;
24
+ }
25
25
  //# sourceMappingURL=lifecycle.d.ts.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=lifecycle.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=module.test.d.ts.map
@@ -1,121 +1,121 @@
1
- import { ModuleAnnotation, ModuleLike } from "@alterior/di";
2
- import { Injector, Provider } from "@alterior/di";
3
- /**
4
- * Combines a module annotation and a target class into a single
5
- * object for storage purposes in Runtime and related objects.
6
- */
7
- export declare class ModuleDefinition {
8
- metadata: ModuleAnnotation;
9
- target: any;
10
- }
11
- /**
12
- * Represents a live instance of a module.
13
- * Contains both the module definition as well
14
- * as a reference to the module instance itself.
15
- */
16
- export declare class ModuleInstance {
17
- readonly definition: ModuleDefinition;
18
- readonly instance: any;
19
- constructor(definition: ModuleDefinition, instance: any);
20
- }
21
- /**
22
- * Used to construct a runtime environment for a given entry module.
23
- * Handles resolving the module tree into an injector as well as constructing
24
- * the module instances and running lifecycle events.
25
- */
26
- export declare class Runtime {
27
- constructor(entryModule: Function);
28
- definitions: ModuleDefinition[];
29
- visited: ModuleLike[];
30
- instances: ModuleInstance[];
31
- /**
32
- * Get a specific service from the dependency injector.
33
- * @param ctor
34
- */
35
- getService<T>(ctor: {
36
- new (...args: any[]): T;
37
- }): T;
38
- /**
39
- * Retrieve the providers that were collected from the
40
- * module graph and used to create the primary injector.
41
- */
42
- providers: Provider[];
43
- /**
44
- * Iterate over the module definitions which are part of this
45
- * runtime and append to the given array the set of dependency injection
46
- * providers which are specified in the module definitions.
47
- *
48
- * @param providers An array which will be populated
49
- */
50
- contributeProviders(providers: Provider[]): void;
51
- /**
52
- * Perform runtime configuration steps
53
- */
54
- configure(): void;
55
- private _selfTest;
56
- /**
57
- * True if the `--self-test` option was used to launch the application.
58
- */
59
- get selfTest(): boolean;
60
- processCommandLine(args: string[]): void;
61
- /**
62
- * Fire an event to all modules which understand it. Should be upper-camel-case, meaning
63
- * to fire the altOnStart() method, send "OnStart".
64
- * @param eventName
65
- */
66
- fireEvent(eventName: string): void;
67
- private _injector;
68
- /**
69
- * Get the runtime's dependency injector. This injector can provide all dependencies specified
70
- * in the imported modules' `providers` definitions.
71
- */
72
- get injector(): Injector;
73
- /**
74
- * Instantiate the modules of this runtime using the given dependency injector.
75
- * The injector will be inherited into an injector that provides the dependencies
76
- * specified in the imported modules' `providers` definitions.
77
- *
78
- * @param injector
79
- */
80
- load(injector: Injector): ModuleInstance[];
81
- /**
82
- * Stop any services, as defined by imported modules of this runtime. For instance, if you import WebServerModule
83
- * from @alterior/web-server, calling this will instruct the module to stop serving on the configured port.
84
- * Also builds in a timeout to allow for all services and operations to stop before resolving.
85
- *
86
- * This will send the `OnStop` lifecycle event to all modules, which triggers the `altOnStop()` method of any module
87
- * which implements it to be called. It also instructs the RolesService to stop any roles which are currently running.
88
- * For more information about Roles, see the documentation for RolesService.
89
- */
90
- stop(): Promise<void>;
91
- /**
92
- * Start any services, as defined by modules. For instance, if you import WebServerModule from @alterior/web-server,
93
- * calling this will instruct the module to begin serving on the configured port.
94
- *
95
- * This will send the `OnStart` lifecycle event to all modules, which triggers the `altOnStart()` method of any module
96
- * which implements it to be called. It also instructs the RolesService to start roles as per it's configuration.
97
- * For more information about Roles, see the documentation for RolesService.
98
- */
99
- start(): void;
100
- /**
101
- * Stop all running services and shut down the process
102
- */
103
- shutdown(): Promise<void>;
104
- /**
105
- * Retrieve the ModuleAnnotation for a given Module definition, whether it be a class annotated
106
- * with `@Module()` or a plain object with `$module` which configures a module class.
107
- *
108
- * This is an alias of ModuleAnnotation.getForClass(module)
109
- *
110
- * @param module
111
- */
112
- getMetadataForModule(module: ModuleLike): ModuleAnnotation;
113
- /**
114
- * Resolves the given module, adding it to this runtime.
115
- * Calls itself for all imports. Visited modules are tracked per runtime,
116
- * so resolveModule() on the same runtime object will not work, preventing
117
- * loops.
118
- */
119
- private resolveModule;
120
- }
1
+ import { ModuleAnnotation, ModuleLike } from "@alterior/di";
2
+ import { Injector, Provider } from "@alterior/di";
3
+ /**
4
+ * Combines a module annotation and a target class into a single
5
+ * object for storage purposes in Runtime and related objects.
6
+ */
7
+ export declare class ModuleDefinition {
8
+ metadata: ModuleAnnotation;
9
+ target: any;
10
+ }
11
+ /**
12
+ * Represents a live instance of a module.
13
+ * Contains both the module definition as well
14
+ * as a reference to the module instance itself.
15
+ */
16
+ export declare class ModuleInstance {
17
+ readonly definition: ModuleDefinition;
18
+ readonly instance: any;
19
+ constructor(definition: ModuleDefinition, instance: any);
20
+ }
21
+ /**
22
+ * Used to construct a runtime environment for a given entry module.
23
+ * Handles resolving the module tree into an injector as well as constructing
24
+ * the module instances and running lifecycle events.
25
+ */
26
+ export declare class Runtime {
27
+ constructor(entryModule: Function);
28
+ definitions: ModuleDefinition[];
29
+ visited: ModuleLike[];
30
+ instances: ModuleInstance[];
31
+ /**
32
+ * Get a specific service from the dependency injector.
33
+ * @param ctor
34
+ */
35
+ getService<T>(ctor: {
36
+ new (...args: any[]): T;
37
+ }): T;
38
+ /**
39
+ * Retrieve the providers that were collected from the
40
+ * module graph and used to create the primary injector.
41
+ */
42
+ providers: Provider[];
43
+ /**
44
+ * Iterate over the module definitions which are part of this
45
+ * runtime and append to the given array the set of dependency injection
46
+ * providers which are specified in the module definitions.
47
+ *
48
+ * @param providers An array which will be populated
49
+ */
50
+ contributeProviders(providers: Provider[]): void;
51
+ /**
52
+ * Perform runtime configuration steps
53
+ */
54
+ configure(): void;
55
+ private _selfTest;
56
+ /**
57
+ * True if the `--self-test` option was used to launch the application.
58
+ */
59
+ get selfTest(): boolean;
60
+ processCommandLine(args: string[]): void;
61
+ /**
62
+ * Fire an event to all modules which understand it. Should be upper-camel-case, meaning
63
+ * to fire the altOnStart() method, send "OnStart".
64
+ * @param eventName
65
+ */
66
+ fireEvent(eventName: string): void;
67
+ private _injector;
68
+ /**
69
+ * Get the runtime's dependency injector. This injector can provide all dependencies specified
70
+ * in the imported modules' `providers` definitions.
71
+ */
72
+ get injector(): Injector;
73
+ /**
74
+ * Instantiate the modules of this runtime using the given dependency injector.
75
+ * The injector will be inherited into an injector that provides the dependencies
76
+ * specified in the imported modules' `providers` definitions.
77
+ *
78
+ * @param injector
79
+ */
80
+ load(injector: Injector): ModuleInstance[];
81
+ /**
82
+ * Stop any services, as defined by imported modules of this runtime. For instance, if you import WebServerModule
83
+ * from @alterior/web-server, calling this will instruct the module to stop serving on the configured port.
84
+ * Also builds in a timeout to allow for all services and operations to stop before resolving.
85
+ *
86
+ * This will send the `OnStop` lifecycle event to all modules, which triggers the `altOnStop()` method of any module
87
+ * which implements it to be called. It also instructs the RolesService to stop any roles which are currently running.
88
+ * For more information about Roles, see the documentation for RolesService.
89
+ */
90
+ stop(): Promise<void>;
91
+ /**
92
+ * Start any services, as defined by modules. For instance, if you import WebServerModule from @alterior/web-server,
93
+ * calling this will instruct the module to begin serving on the configured port.
94
+ *
95
+ * This will send the `OnStart` lifecycle event to all modules, which triggers the `altOnStart()` method of any module
96
+ * which implements it to be called. It also instructs the RolesService to start roles as per it's configuration.
97
+ * For more information about Roles, see the documentation for RolesService.
98
+ */
99
+ start(): void;
100
+ /**
101
+ * Stop all running services and shut down the process
102
+ */
103
+ shutdown(): Promise<void>;
104
+ /**
105
+ * Retrieve the ModuleAnnotation for a given Module definition, whether it be a class annotated
106
+ * with `@Module()` or a plain object with `$module` which configures a module class.
107
+ *
108
+ * This is an alias of ModuleAnnotation.getForClass(module)
109
+ *
110
+ * @param module
111
+ */
112
+ getMetadataForModule(module: ModuleLike): ModuleAnnotation;
113
+ /**
114
+ * Resolves the given module, adding it to this runtime.
115
+ * Calls itself for all imports. Visited modules are tracked per runtime,
116
+ * so resolveModule() on the same runtime object will not work, preventing
117
+ * loops.
118
+ */
119
+ private resolveModule;
120
+ }
121
121
  //# sourceMappingURL=modules.d.ts.map