@xrystal/core 3.11.3 → 3.11.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.11.3",
4
+ "version": "3.11.5",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -1,16 +1,16 @@
1
1
  export declare class X {
2
2
  private container;
3
3
  constructor();
4
- registerService(ServiceClass: any): void;
5
- registerServices(services: any[]): void;
6
- registerInstance(name: string, instance: any): void;
4
+ registerService(ServiceClass: any): this;
5
+ registerServices(services: any[]): this;
6
+ registerInstance(name: string, instance: any): this;
7
7
  initialize(input: {
8
8
  service: any;
9
9
  props?: any;
10
10
  } | {
11
11
  service: any;
12
12
  props?: any;
13
- }[]): Promise<void>;
13
+ }[]): Promise<this>;
14
14
  get<T>(name: string | any): T;
15
15
  get cradle(): any;
16
16
  }
@@ -12,16 +12,19 @@ export class X {
12
12
  this.container.register({
13
13
  [name]: asClass(ServiceClass).singleton()
14
14
  });
15
+ return this;
15
16
  }
16
17
  registerServices(services) {
17
18
  services.forEach(ServiceClass => {
18
19
  this.registerService(ServiceClass);
19
20
  });
21
+ return this;
20
22
  }
21
23
  registerInstance(name, instance) {
22
24
  this.container.register({
23
25
  [name]: asValue(instance)
24
26
  });
27
+ return this;
25
28
  }
26
29
  async initialize(input) {
27
30
  const items = Array.isArray(input) ? input : [input];
@@ -31,6 +34,7 @@ export class X {
31
34
  await instance.load(item.props);
32
35
  }
33
36
  }
37
+ return this;
34
38
  }
35
39
  get(name) {
36
40
  const resolveName = typeof name === 'function'