@ianlucas/cs2-lib 7.0.0-beta.1 → 7.0.0-beta.2

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 (39) hide show
  1. package/dist/economy-constants.d.mts +15 -16
  2. package/dist/economy-container.d.mts +2 -3
  3. package/dist/economy-types.d.mts +0 -1
  4. package/dist/economy.d.mts +3 -3
  5. package/dist/inventory.d.mts +0 -1
  6. package/dist/items.d.mts +0 -3
  7. package/dist/sticker-markup.d.mts +0 -3
  8. package/dist/teams.d.mts +0 -1
  9. package/dist/translations/brazilian.d.mts +0 -3
  10. package/dist/translations/bulgarian.d.mts +0 -3
  11. package/dist/translations/czech.d.mts +0 -3
  12. package/dist/translations/danish.d.mts +0 -3
  13. package/dist/translations/dutch.d.mts +0 -3
  14. package/dist/translations/english.d.mts +0 -3
  15. package/dist/translations/finnish.d.mts +0 -3
  16. package/dist/translations/french.d.mts +0 -3
  17. package/dist/translations/german.d.mts +0 -3
  18. package/dist/translations/greek.d.mts +0 -3
  19. package/dist/translations/hungarian.d.mts +0 -3
  20. package/dist/translations/indonesian.d.mts +0 -3
  21. package/dist/translations/italian.d.mts +0 -3
  22. package/dist/translations/japanese.d.mts +0 -3
  23. package/dist/translations/koreana.d.mts +0 -3
  24. package/dist/translations/latam.d.mts +0 -3
  25. package/dist/translations/norwegian.d.mts +0 -3
  26. package/dist/translations/polish.d.mts +0 -3
  27. package/dist/translations/portuguese.d.mts +0 -3
  28. package/dist/translations/romanian.d.mts +0 -3
  29. package/dist/translations/russian.d.mts +0 -3
  30. package/dist/translations/schinese.d.mts +0 -3
  31. package/dist/translations/spanish.d.mts +0 -3
  32. package/dist/translations/swedish.d.mts +0 -3
  33. package/dist/translations/tchinese.d.mts +0 -3
  34. package/dist/translations/thai.d.mts +0 -3
  35. package/dist/translations/turkish.d.mts +0 -3
  36. package/dist/translations/ukrainian.d.mts +0 -3
  37. package/dist/translations/vietnamese.d.mts +0 -3
  38. package/dist/utils.d.mts +0 -5
  39. package/package.json +1 -1
@@ -2,36 +2,35 @@ import { CS2ItemTypeValues } from "./economy-types.mjs";
2
2
  import { CS2TeamValues } from "./teams.mjs";
3
3
 
4
4
  //#region src/economy-constants.d.ts
5
-
6
5
  declare const CS2_MIN_STATTRAK = 0;
7
6
  declare const CS2_MAX_STATTRAK = 999999;
8
7
  declare const CS2_MIN_WEAR = 0;
9
8
  declare const CS2_MAX_WEAR = 1;
10
- declare const CS2_DEFAULT_MIN_WEAR = .06;
11
- declare const CS2_DEFAULT_MAX_WEAR = .8;
9
+ declare const CS2_DEFAULT_MIN_WEAR = 0.06;
10
+ declare const CS2_DEFAULT_MAX_WEAR = 0.8;
12
11
  declare const CS2_MIN_FACTORY_NEW_WEAR: number;
13
- declare const CS2_MAX_FACTORY_NEW_WEAR = .07;
14
- declare const CS2_MIN_MINIMAL_WEAR_WEAR = .070001;
15
- declare const CS2_MAX_MINIMAL_WEAR_WEAR = .15;
16
- declare const CS2_MIN_FIELD_TESTED_WEAR = .150001;
17
- declare const CS2_MAX_FIELD_TESTED_WEAR = .37;
18
- declare const CS2_MIN_WELL_WORN_WEAR = .370001;
19
- declare const CS2_MAX_WELL_WORN_WEAR = .44;
20
- declare const CS2_MIN_BATTLE_SCARRED_WEAR = .440001;
12
+ declare const CS2_MAX_FACTORY_NEW_WEAR = 0.07;
13
+ declare const CS2_MIN_MINIMAL_WEAR_WEAR = 0.070001;
14
+ declare const CS2_MAX_MINIMAL_WEAR_WEAR = 0.15;
15
+ declare const CS2_MIN_FIELD_TESTED_WEAR = 0.150001;
16
+ declare const CS2_MAX_FIELD_TESTED_WEAR = 0.37;
17
+ declare const CS2_MIN_WELL_WORN_WEAR = 0.370001;
18
+ declare const CS2_MAX_WELL_WORN_WEAR = 0.44;
19
+ declare const CS2_MIN_BATTLE_SCARRED_WEAR = 0.440001;
21
20
  declare const CS2_MAX_BATTLE_SCARRED_WEAR: number;
22
21
  declare const CS2_MIN_SEED = 1;
23
- declare const CS2_MAX_SEED = 1e3;
22
+ declare const CS2_MAX_SEED = 1000;
24
23
  declare const CS2_MIN_STICKER_WEAR = 0;
25
- declare const CS2_MAX_STICKER_WEAR = .9;
24
+ declare const CS2_MAX_STICKER_WEAR = 0.9;
26
25
  declare const CS2_MIN_STICKER_ROTATION = 0;
27
26
  declare const CS2_MAX_STICKER_ROTATION = 359;
28
27
  declare const CS2_MIN_KEYCHAIN_SEED = 1;
29
- declare const CS2_MAX_KEYCHAIN_SEED = 1e5;
28
+ declare const CS2_MAX_KEYCHAIN_SEED = 100000;
30
29
  declare const CS2_MAX_STICKERS = 5;
31
30
  declare const CS2_MAX_PATCHES = 5;
32
31
  declare const CS2_MAX_KEYCHAINS = 1;
33
- declare const CS2_STICKER_WEAR_FACTOR = .1;
34
- declare const CS2_WEAR_FACTOR = 1e-6;
32
+ declare const CS2_STICKER_WEAR_FACTOR = 0.1;
33
+ declare const CS2_WEAR_FACTOR = 0.000001;
35
34
  declare const CS2_NAMETAG_RE: RegExp;
36
35
  declare const CS2_CONTRACT_TOOL_DEF = 62;
37
36
  declare const CS2_NAMETAG_TOOL_DEF = 1200;
@@ -1,7 +1,6 @@
1
1
  import { EnumValues } from "./utils.mjs";
2
2
 
3
3
  //#region src/economy-container.d.ts
4
-
5
4
  declare const CS2Rarity: {
6
5
  readonly Common: "common";
7
6
  readonly Uncommon: "uncommon";
@@ -58,8 +57,8 @@ declare const CS2RarityColorOrder: {
58
57
  readonly "#e4ae39": 7;
59
58
  };
60
59
  declare const CS2_RARITY_COLOR_DEFAULT = 0;
61
- declare const CS2_BASE_ODD = .8;
62
- declare const CS2_STATTRAK_ODD = .1;
60
+ declare const CS2_BASE_ODD = 0.8;
61
+ declare const CS2_STATTRAK_ODD = 0.1;
63
62
  declare function randomFloat(min: number, max: number): number;
64
63
  declare function randomInt(min: number, max: number): number;
65
64
  declare function randomBoolean(): boolean;
@@ -2,7 +2,6 @@ import { EnumValues } from "./utils.mjs";
2
2
  import { CS2RarityColorValues, CS2RaritySoundNameValues } from "./economy-container.mjs";
3
3
 
4
4
  //#region src/economy-types.d.ts
5
-
6
5
  declare const CS2ItemTeam: {
7
6
  readonly T: 0;
8
7
  readonly CT: 1;
@@ -91,14 +91,14 @@ declare class CS2EconomyItem implements Interface<Omit<CS2Item, "contents" | "sp
91
91
  private _teams;
92
92
  constructor(economy: CS2EconomyInstance, item: CS2Item, language: CS2ItemTranslation);
93
93
  set contents(value: number[] | undefined);
94
- get contents(): number[] | undefined;
94
+ get contents(): CS2EconomyItem[];
95
95
  get parent(): CS2EconomyItem | undefined;
96
96
  get rawContents(): number[] | undefined;
97
97
  get rawSpecials(): number[] | undefined;
98
98
  set specials(value: number[] | undefined);
99
- get specials(): number[] | undefined;
99
+ get specials(): CS2EconomyItem[] | undefined;
100
100
  set teams(value: CS2ItemTeamValues);
101
- get teams(): CS2ItemTeamValues;
101
+ get teams(): CS2TeamValues[] | undefined;
102
102
  isC4(): boolean;
103
103
  isPistol(): boolean;
104
104
  isSMG(): boolean;
@@ -45,7 +45,6 @@ interface CS2InventorySpec extends CS2InventoryOptions {
45
45
  }
46
46
  declare const CS2_INVENTORY_VERSION = 1;
47
47
  declare const CS2_INVENTORY_TIMESTAMP = 1707696138408;
48
- // prettier-ignore
49
48
  declare const CS2_INVENTORY_EQUIPPABLE_ITEMS: CS2ItemTypeValues[];
50
49
  declare function getTimestamp(): number;
51
50
  declare function getNextUid(map: Map<number, unknown>): number;
package/dist/items.d.mts CHANGED
@@ -1,9 +1,6 @@
1
1
  import { CS2Item } from "./economy-types.mjs";
2
2
 
3
3
  //#region src/items.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const CS2_ITEMS: CS2Item[];
8
5
  //#endregion
9
6
  export { CS2_ITEMS };
@@ -1,9 +1,6 @@
1
1
  import { CS2StickerMarkup } from "./economy-types.mjs";
2
2
 
3
3
  //#region src/sticker-markup.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const CS2_STICKER_MARKUP: CS2StickerMarkup;
8
5
  //#endregion
9
6
  export { CS2_STICKER_MARKUP };
package/dist/teams.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { EnumValues } from "./utils.mjs";
2
2
 
3
3
  //#region src/teams.d.ts
4
-
5
4
  declare const CS2Team: {
6
5
  readonly None: 0;
7
6
  readonly T: 2;
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/brazilian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const brazilian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { brazilian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/bulgarian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const bulgarian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { bulgarian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/czech.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const czech: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { czech };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/danish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const danish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { danish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/dutch.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const dutch: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { dutch };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/english.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const english: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { english };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/finnish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const finnish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { finnish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/french.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const french: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { french };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/german.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const german: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { german };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/greek.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const greek: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { greek };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/hungarian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const hungarian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { hungarian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/indonesian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const indonesian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { indonesian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/italian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const italian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { italian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/japanese.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const japanese: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { japanese };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/koreana.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const koreana: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { koreana };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/latam.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const latam: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { latam };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/norwegian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const norwegian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { norwegian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/polish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const polish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { polish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/portuguese.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const portuguese: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { portuguese };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/romanian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const romanian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { romanian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/russian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const russian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { russian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/schinese.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const schinese: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { schinese };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/spanish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const spanish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { spanish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/swedish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const swedish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { swedish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/tchinese.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const tchinese: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { tchinese };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/thai.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const thai: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { thai };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/turkish.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const turkish: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { turkish };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/ukrainian.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const ukrainian: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { ukrainian };
@@ -1,9 +1,6 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
 
3
3
  //#region src/translations/vietnamese.d.ts
4
-
5
- // @generated
6
- // @ts-ignore
7
4
  declare const vietnamese: CS2ItemTranslationMap;
8
5
  //#endregion
9
6
  export { vietnamese };
package/dist/utils.d.mts CHANGED
@@ -1,10 +1,5 @@
1
1
  //#region src/utils.d.ts
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Ian Lucas. All rights reserved.
4
- * Licensed under the MIT License. See License.txt in the project root for license information.
5
- *--------------------------------------------------------------------------------------------*/
6
2
  type EnumValues<T> = T[keyof T];
7
- // @see https://stackoverflow.com/a/69895725
8
3
  type Interface<T extends object> = { [key in T extends any ? { [K in keyof T]-?: {} extends Pick<T, K> ? never : K }[keyof T] : never]: T[key] } & { [key in T extends any ? { [K in keyof T]-?: {} extends Pick<T, K> ? K : never }[keyof T] : never]-?: T[key] | undefined };
9
4
  type MapValue<T> = T extends Map<any, infer I> ? I : never;
10
5
  type RecordValue<T> = T extends Record<any, infer I> ? I : never;
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "typescript": "^5.8.3",
56
56
  "vitest": "^3.2.4"
57
57
  },
58
- "version": "7.0.0-beta.1"
58
+ "version": "7.0.0-beta.2"
59
59
  }