@armoury/fivem-roleplay-gamemode-common 1.0.38 → 1.0.40

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.
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./models"), exports);
18
+ __exportStar(require("./stub"), exports);
@@ -15,6 +15,14 @@ var House = /** @class */ (function () {
15
15
  this.rentPrice = rentPrice;
16
16
  this.requiredLevel = requiredLevel;
17
17
  }
18
+ House.toStub = function (house) {
19
+ return {
20
+ id: house.id,
21
+ sellingPrice: house.sellingPrice,
22
+ rentPrice: house.rentPrice,
23
+ requiredLevel: house.requiredLevel,
24
+ };
25
+ };
18
26
  return House;
19
27
  }());
20
28
  exports.House = House;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from './models';
2
+ export * from './stub';
@@ -12,6 +12,14 @@ var House = /** @class */ (function () {
12
12
  this.rentPrice = rentPrice;
13
13
  this.requiredLevel = requiredLevel;
14
14
  }
15
+ House.toStub = function (house) {
16
+ return {
17
+ id: house.id,
18
+ sellingPrice: house.sellingPrice,
19
+ rentPrice: house.rentPrice,
20
+ requiredLevel: house.requiredLevel,
21
+ };
22
+ };
15
23
  return House;
16
24
  }());
17
25
  export { House };
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
1
  export * from './models';
2
+ export * from './stub';
@@ -1,3 +1,4 @@
1
+ import type { Stub } from '@armoury/fivem-framework-common';
1
2
  export interface House {
2
3
  readonly id: number;
3
4
  readonly owner: number | null;
@@ -18,6 +19,7 @@ export declare class House {
18
19
  readonly rentPrice: number;
19
20
  readonly requiredLevel: number;
20
21
  constructor(id: number, owner: number | null, entrance: Position, exit: Position, originalValue: number, sellingPrice?: number, rentPrice?: number, requiredLevel?: number);
22
+ static toStub(house: House): Stub<House>;
21
23
  }
22
24
  type Position = {
23
25
  x: number;
@@ -0,0 +1,14 @@
1
+ import type { House } from './models/house/house';
2
+ declare module '@armoury/fivem-framework-common' {
3
+ interface StubFieldRegistry {
4
+ House: {
5
+ model: House;
6
+ fields: {
7
+ sellingPrice: number;
8
+ rentPrice: number;
9
+ requiredLevel: number;
10
+ };
11
+ };
12
+ }
13
+ }
14
+ export type { Stub } from '@armoury/fivem-framework-common';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-roleplay-gamemode-common",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Shared APIs for the Armoury FiveM roleplay gamemode",
5
5
  "main": "dist/cjs/shared/index.js",
6
6
  "module": "dist/esm/shared/index.js",
@@ -13,6 +13,9 @@
13
13
  }
14
14
  },
15
15
  "files": ["dist"],
16
+ "peerDependencies": {
17
+ "@armoury/fivem-framework-common": "^1.0.40"
18
+ },
16
19
  "scripts": {
17
20
  "build": "npm run build:cjs && npm run build:esm && npm run build:types",
18
21
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -22,4 +25,4 @@
22
25
  "publishConfig": {
23
26
  "access": "public"
24
27
  }
25
- }
28
+ }