electron-injector 1.0.2 → 1.0.3

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.
package/dist/index.cjs CHANGED
@@ -52,15 +52,15 @@ var import_reflect_metadata = require("reflect-metadata");
52
52
  var import_rxjs = require("rxjs");
53
53
 
54
54
  // src/errors.ts
55
- var ElectronDiError = class extends Error {
55
+ var ElectronInjectorError = class extends Error {
56
56
  static {
57
- __name(this, "ElectronDiError");
57
+ __name(this, "ElectronInjectorError");
58
58
  }
59
59
  constructor(message) {
60
60
  super(message);
61
61
  }
62
62
  };
63
- var ProviderNotFound = class extends ElectronDiError {
63
+ var ProviderNotFound = class extends ElectronInjectorError {
64
64
  static {
65
65
  __name(this, "ProviderNotFound");
66
66
  }
@@ -68,7 +68,7 @@ var ProviderNotFound = class extends ElectronDiError {
68
68
  super(`Provider '${providerName}' not found`);
69
69
  }
70
70
  };
71
- var CircularDependency = class extends ElectronDiError {
71
+ var CircularDependency = class extends ElectronInjectorError {
72
72
  static {
73
73
  __name(this, "CircularDependency");
74
74
  }
@@ -76,7 +76,7 @@ var CircularDependency = class extends ElectronDiError {
76
76
  super(`Circular dependency detected for provider '${providerName}'`);
77
77
  }
78
78
  };
79
- var ProviderIsNotInjectable = class extends ElectronDiError {
79
+ var ProviderIsNotInjectable = class extends ElectronInjectorError {
80
80
  static {
81
81
  __name(this, "ProviderIsNotInjectable");
82
82
  }
@@ -84,7 +84,7 @@ var ProviderIsNotInjectable = class extends ElectronDiError {
84
84
  super(`Provider '${providerName}' is not injectable. Please ensure it is decorated with @Injectable()`);
85
85
  }
86
86
  };
87
- var ControllerIsNotValid = class extends ElectronDiError {
87
+ var ControllerIsNotValid = class extends ElectronInjectorError {
88
88
  static {
89
89
  __name(this, "ControllerIsNotValid");
90
90
  }
@@ -225,12 +225,15 @@ var DEV_LOGGER = devLogger;
225
225
 
226
226
  // src/application.ts
227
227
  var import_electron = require("electron");
228
- var Application = class {
228
+ var Application = class _Application {
229
229
  static {
230
230
  __name(this, "Application");
231
231
  }
232
232
  configOptions;
233
233
  container = new Container();
234
+ static create(configOptions) {
235
+ return new _Application(configOptions);
236
+ }
234
237
  constructor(configOptions) {
235
238
  this.configOptions = configOptions;
236
239
  this.loadProviders();
package/dist/index.d.cts CHANGED
@@ -38,6 +38,7 @@ interface ConfigOptions {
38
38
  declare class Application {
39
39
  private configOptions;
40
40
  private container;
41
+ static create(configOptions: ConfigOptions): Application;
41
42
  constructor(configOptions: ConfigOptions);
42
43
  private loadProviders;
43
44
  private loadControllers;
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ interface ConfigOptions {
38
38
  declare class Application {
39
39
  private configOptions;
40
40
  private container;
41
+ static create(configOptions: ConfigOptions): Application;
41
42
  constructor(configOptions: ConfigOptions);
42
43
  private loadProviders;
43
44
  private loadControllers;
package/dist/index.js CHANGED
@@ -8,15 +8,15 @@ import "reflect-metadata";
8
8
  import { first, lastValueFrom, Observable } from "rxjs";
9
9
 
10
10
  // src/errors.ts
11
- var ElectronDiError = class extends Error {
11
+ var ElectronInjectorError = class extends Error {
12
12
  static {
13
- __name(this, "ElectronDiError");
13
+ __name(this, "ElectronInjectorError");
14
14
  }
15
15
  constructor(message) {
16
16
  super(message);
17
17
  }
18
18
  };
19
- var ProviderNotFound = class extends ElectronDiError {
19
+ var ProviderNotFound = class extends ElectronInjectorError {
20
20
  static {
21
21
  __name(this, "ProviderNotFound");
22
22
  }
@@ -24,7 +24,7 @@ var ProviderNotFound = class extends ElectronDiError {
24
24
  super(`Provider '${providerName}' not found`);
25
25
  }
26
26
  };
27
- var CircularDependency = class extends ElectronDiError {
27
+ var CircularDependency = class extends ElectronInjectorError {
28
28
  static {
29
29
  __name(this, "CircularDependency");
30
30
  }
@@ -32,7 +32,7 @@ var CircularDependency = class extends ElectronDiError {
32
32
  super(`Circular dependency detected for provider '${providerName}'`);
33
33
  }
34
34
  };
35
- var ProviderIsNotInjectable = class extends ElectronDiError {
35
+ var ProviderIsNotInjectable = class extends ElectronInjectorError {
36
36
  static {
37
37
  __name(this, "ProviderIsNotInjectable");
38
38
  }
@@ -40,7 +40,7 @@ var ProviderIsNotInjectable = class extends ElectronDiError {
40
40
  super(`Provider '${providerName}' is not injectable. Please ensure it is decorated with @Injectable()`);
41
41
  }
42
42
  };
43
- var ControllerIsNotValid = class extends ElectronDiError {
43
+ var ControllerIsNotValid = class extends ElectronInjectorError {
44
44
  static {
45
45
  __name(this, "ControllerIsNotValid");
46
46
  }
@@ -181,12 +181,15 @@ var DEV_LOGGER = devLogger;
181
181
 
182
182
  // src/application.ts
183
183
  import { ipcMain } from "electron";
184
- var Application = class {
184
+ var Application = class _Application {
185
185
  static {
186
186
  __name(this, "Application");
187
187
  }
188
188
  configOptions;
189
189
  container = new Container();
190
+ static create(configOptions) {
191
+ return new _Application(configOptions);
192
+ }
190
193
  constructor(configOptions) {
191
194
  this.configOptions = configOptions;
192
195
  this.loadProviders();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-injector",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Biblioteca para el desarrollo de aplicaciones con electron que proporciona una arquitectura robusta con inyección e inversion de dependencias.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",