@armoury/fivem-framework-client 1.0.11 → 1.0.12

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.
@@ -16,9 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CLIENT_PROVIDERS = void 0;
19
- exports.Client_Init = Client_Init;
19
+ exports.bootstrap = bootstrap;
20
20
  require("reflect-metadata");
21
- const injection_js_1 = require("injection-js");
22
21
  const services_1 = require("./services");
23
22
  const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
24
23
  exports.CLIENT_PROVIDERS = [
@@ -34,12 +33,8 @@ exports.CLIENT_PROVIDERS = [
34
33
  services_1.ClientUIService,
35
34
  services_1.ClientWaypointsService,
36
35
  ];
37
- function Client_Init(_class, ...providers) {
38
- const mainInjector = injection_js_1.ReflectiveInjector.resolveAndCreate(exports.CLIENT_PROVIDERS);
39
- const injector = injection_js_1.ReflectiveInjector.resolveAndCreate([...providers, _class], mainInjector);
40
- const instance = injector.get(_class);
41
- (0, fivem_framework_common_1.Decorate)(instance, _class.prototype, [...exports.CLIENT_PROVIDERS, ...providers], fivem_framework_common_1.DecorationType.CLIENT);
42
- return instance;
36
+ async function bootstrap(_class, options = {}) {
37
+ return (0, fivem_framework_common_1.bootstrapWithProviders)(_class, exports.CLIENT_PROVIDERS, options, fivem_framework_common_1.DecorationType.CLIENT);
43
38
  }
44
39
  __exportStar(require("./services"), exports);
45
40
  __exportStar(require("@armoury/fivem-framework-common"), exports);
@@ -1,8 +1,7 @@
1
1
  /// <reference path = "../ambient.declarations.d.ts" />
2
2
  import 'reflect-metadata';
3
- import { ReflectiveInjector } from 'injection-js';
4
3
  import { ClientActionPointsService, ClientBlipsService, ClientCheckpointsService, ClientMarkersService, ClientPedsService, ClientSessionService, ClientTicksService, ClientUIService, ClientVehiclesService, ClientWaypointsService, ClientHudService } from './services';
5
- import { Decorate, DecorationType } from '@armoury/fivem-framework-common';
4
+ import { bootstrapWithProviders, DecorationType } from '@armoury/fivem-framework-common';
6
5
  export const CLIENT_PROVIDERS = [
7
6
  ClientActionPointsService,
8
7
  ClientBlipsService,
@@ -16,12 +15,8 @@ export const CLIENT_PROVIDERS = [
16
15
  ClientUIService,
17
16
  ClientWaypointsService,
18
17
  ];
19
- export function Client_Init(_class, ...providers) {
20
- const mainInjector = ReflectiveInjector.resolveAndCreate(CLIENT_PROVIDERS);
21
- const injector = ReflectiveInjector.resolveAndCreate([...providers, _class], mainInjector);
22
- const instance = injector.get(_class);
23
- Decorate(instance, _class.prototype, [...CLIENT_PROVIDERS, ...providers], DecorationType.CLIENT);
24
- return instance;
18
+ export async function bootstrap(_class, options = {}) {
19
+ return bootstrapWithProviders(_class, CLIENT_PROVIDERS, options, DecorationType.CLIENT);
25
20
  }
26
21
  export * from './services';
27
22
  export * from '@armoury/fivem-framework-common';
@@ -2,9 +2,10 @@
2
2
  import 'reflect-metadata';
3
3
  import { Provider } from 'injection-js';
4
4
  import { ClientActionPointsService, ClientBlipsService, ClientCheckpointsService, ClientMarkersService, ClientPedsService, ClientSessionService, ClientTicksService, ClientUIService, ClientVehiclesService, ClientWaypointsService, ClientHudService } from './services';
5
+ import { BootstrapOptions } from '@armoury/fivem-framework-common';
5
6
  export declare const CLIENT_PROVIDERS: (typeof ClientTicksService | typeof ClientActionPointsService | typeof ClientBlipsService | typeof ClientCheckpointsService | typeof ClientHudService | typeof ClientMarkersService | typeof ClientPedsService | typeof ClientSessionService | typeof ClientVehiclesService | typeof ClientUIService | typeof ClientWaypointsService)[];
6
- export declare function Client_Init<T extends {
7
+ export declare function bootstrap<T extends {
7
8
  new (...args: any[]): any;
8
- } & Provider>(_class: T, ...providers: Provider[]): T;
9
+ } & Provider>(_class: T, options?: BootstrapOptions): Promise<InstanceType<T>>;
9
10
  export * from './services';
10
11
  export * from '@armoury/fivem-framework-common';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-framework-client",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Client APIs for the Armoury FiveM framework",
5
5
  "main": "dist/cjs/client/index.js",
6
6
  "module": "dist/esm/client/index.js",
@@ -25,7 +25,7 @@
25
25
  "rxjs": "^7.8.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "@armoury/fivem-framework-common": "1.0.11"
28
+ "@armoury/fivem-framework-common": "1.0.12"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"