@ianlucas/cs2-lib 9.1.0-rc.2 → 9.1.0

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 (47) hide show
  1. package/dist/economy-constants.d.mts +66 -67
  2. package/dist/economy-container.d.mts +18 -19
  3. package/dist/economy-types.d.mts +17 -18
  4. package/dist/economy.d.mts +4 -5
  5. package/dist/inventory-format.d.mts +10 -11
  6. package/dist/inventory-migrations/index.d.mts +5 -6
  7. package/dist/inventory-rules.d.mts +25 -26
  8. package/dist/inventory-types.d.mts +5 -6
  9. package/dist/inventory.d.mts +9 -10
  10. package/dist/items.d.mts +2 -3
  11. package/dist/items.mjs +1 -1
  12. package/dist/keyvalues.d.mts +2 -3
  13. package/dist/keyvalues3.d.mts +2 -3
  14. package/dist/maps.d.mts +14 -15
  15. package/dist/teams.d.mts +4 -5
  16. package/dist/translations/brazilian.d.mts +2 -3
  17. package/dist/translations/bulgarian.d.mts +2 -3
  18. package/dist/translations/czech.d.mts +2 -3
  19. package/dist/translations/danish.d.mts +2 -3
  20. package/dist/translations/dutch.d.mts +2 -3
  21. package/dist/translations/english.d.mts +2 -3
  22. package/dist/translations/finnish.d.mts +2 -3
  23. package/dist/translations/french.d.mts +2 -3
  24. package/dist/translations/german.d.mts +2 -3
  25. package/dist/translations/greek.d.mts +2 -3
  26. package/dist/translations/hungarian.d.mts +2 -3
  27. package/dist/translations/indonesian.d.mts +2 -3
  28. package/dist/translations/italian.d.mts +2 -3
  29. package/dist/translations/japanese.d.mts +2 -3
  30. package/dist/translations/koreana.d.mts +2 -3
  31. package/dist/translations/latam.d.mts +2 -3
  32. package/dist/translations/norwegian.d.mts +2 -3
  33. package/dist/translations/polish.d.mts +2 -3
  34. package/dist/translations/portuguese.d.mts +2 -3
  35. package/dist/translations/romanian.d.mts +2 -3
  36. package/dist/translations/russian.d.mts +2 -3
  37. package/dist/translations/schinese.d.mts +2 -3
  38. package/dist/translations/spanish.d.mts +2 -3
  39. package/dist/translations/swedish.d.mts +2 -3
  40. package/dist/translations/tchinese.d.mts +2 -3
  41. package/dist/translations/thai.d.mts +2 -3
  42. package/dist/translations/turkish.d.mts +2 -3
  43. package/dist/translations/ukrainian.d.mts +2 -3
  44. package/dist/translations/vietnamese.d.mts +2 -3
  45. package/dist/utils.d.mts +17 -18
  46. package/dist/veto.d.mts +9 -10
  47. package/package.json +3 -3
@@ -1,6 +1,5 @@
1
1
  //#region src/keyvalues.d.ts
2
- declare class CS2KeyValues {
2
+ export declare class CS2KeyValues {
3
3
  static parse<T = any>(data: string): T;
4
4
  }
5
- //#endregion
6
- export { CS2KeyValues };
5
+ //#endregion
@@ -1,6 +1,5 @@
1
1
  //#region src/keyvalues3.d.ts
2
- declare class CS2KeyValues3 {
2
+ export declare class CS2KeyValues3 {
3
3
  static parse<T = any>(data: string): T;
4
4
  }
5
- //#endregion
6
- export { CS2KeyValues3 };
5
+ //#endregion
package/dist/maps.d.mts CHANGED
@@ -1,19 +1,18 @@
1
1
  //#region src/maps.d.ts
2
- interface CS2Map {
2
+ export interface CS2Map {
3
3
  mapname: string;
4
4
  name: string;
5
5
  }
6
- declare const CS2_ANCIENT_MAP: CS2Map;
7
- declare const CS2_ANUBIS_MAP: CS2Map;
8
- declare const CS2_INFERNO_MAP: CS2Map;
9
- declare const CS2_MIRAGE_MAP: CS2Map;
10
- declare const CS2_DUST2_MAP: CS2Map;
11
- declare const CS2_NUKE_MAP: CS2Map;
12
- declare const CS2_OVERPASS_MAP: CS2Map;
13
- declare const CS2_VERTIGO_MAP: CS2Map;
14
- declare const CS2_TRAIN_MAP: CS2Map;
15
- declare const CS2_CACHE_MAP: CS2Map;
16
- declare const CS2_ALL_MAPS: CS2Map[];
17
- declare function getMapnameName(mapname: string): string;
18
- //#endregion
19
- export { CS2Map, CS2_ALL_MAPS, CS2_ANCIENT_MAP, CS2_ANUBIS_MAP, CS2_CACHE_MAP, CS2_DUST2_MAP, CS2_INFERNO_MAP, CS2_MIRAGE_MAP, CS2_NUKE_MAP, CS2_OVERPASS_MAP, CS2_TRAIN_MAP, CS2_VERTIGO_MAP, getMapnameName };
6
+ export declare const CS2_ANCIENT_MAP: CS2Map;
7
+ export declare const CS2_ANUBIS_MAP: CS2Map;
8
+ export declare const CS2_INFERNO_MAP: CS2Map;
9
+ export declare const CS2_MIRAGE_MAP: CS2Map;
10
+ export declare const CS2_DUST2_MAP: CS2Map;
11
+ export declare const CS2_NUKE_MAP: CS2Map;
12
+ export declare const CS2_OVERPASS_MAP: CS2Map;
13
+ export declare const CS2_VERTIGO_MAP: CS2Map;
14
+ export declare const CS2_TRAIN_MAP: CS2Map;
15
+ export declare const CS2_CACHE_MAP: CS2Map;
16
+ export declare const CS2_ALL_MAPS: CS2Map[];
17
+ export declare function getMapnameName(mapname: string): string;
18
+ //#endregion
package/dist/teams.d.mts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { EnumValues } from "./utils.mjs";
2
2
  //#region src/teams.d.ts
3
- declare const CS2Team: {
3
+ export declare const CS2Team: {
4
4
  readonly None: 0;
5
5
  readonly T: 2;
6
6
  readonly CT: 3;
7
7
  };
8
- type CS2Team = EnumValues<typeof CS2Team>;
9
- declare function toggleCS2Team(team: CS2Team): CS2Team;
10
- //#endregion
11
- export { CS2Team, toggleCS2Team };
8
+ export type CS2Team = EnumValues<typeof CS2Team>;
9
+ export declare function toggleCS2Team(team: CS2Team): CS2Team;
10
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/brazilian.d.ts
3
- declare const brazilian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { brazilian };
3
+ export declare const brazilian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/bulgarian.d.ts
3
- declare const bulgarian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { bulgarian };
3
+ export declare const bulgarian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/czech.d.ts
3
- declare const czech: CS2ItemTranslationMap;
4
- //#endregion
5
- export { czech };
3
+ export declare const czech: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/danish.d.ts
3
- declare const danish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { danish };
3
+ export declare const danish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/dutch.d.ts
3
- declare const dutch: CS2ItemTranslationMap;
4
- //#endregion
5
- export { dutch };
3
+ export declare const dutch: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/english.d.ts
3
- declare const english: CS2ItemTranslationMap;
4
- //#endregion
5
- export { english };
3
+ export declare const english: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/finnish.d.ts
3
- declare const finnish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { finnish };
3
+ export declare const finnish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/french.d.ts
3
- declare const french: CS2ItemTranslationMap;
4
- //#endregion
5
- export { french };
3
+ export declare const french: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/german.d.ts
3
- declare const german: CS2ItemTranslationMap;
4
- //#endregion
5
- export { german };
3
+ export declare const german: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/greek.d.ts
3
- declare const greek: CS2ItemTranslationMap;
4
- //#endregion
5
- export { greek };
3
+ export declare const greek: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/hungarian.d.ts
3
- declare const hungarian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { hungarian };
3
+ export declare const hungarian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/indonesian.d.ts
3
- declare const indonesian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { indonesian };
3
+ export declare const indonesian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/italian.d.ts
3
- declare const italian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { italian };
3
+ export declare const italian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/japanese.d.ts
3
- declare const japanese: CS2ItemTranslationMap;
4
- //#endregion
5
- export { japanese };
3
+ export declare const japanese: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/koreana.d.ts
3
- declare const koreana: CS2ItemTranslationMap;
4
- //#endregion
5
- export { koreana };
3
+ export declare const koreana: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/latam.d.ts
3
- declare const latam: CS2ItemTranslationMap;
4
- //#endregion
5
- export { latam };
3
+ export declare const latam: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/norwegian.d.ts
3
- declare const norwegian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { norwegian };
3
+ export declare const norwegian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/polish.d.ts
3
- declare const polish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { polish };
3
+ export declare const polish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/portuguese.d.ts
3
- declare const portuguese: CS2ItemTranslationMap;
4
- //#endregion
5
- export { portuguese };
3
+ export declare const portuguese: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/romanian.d.ts
3
- declare const romanian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { romanian };
3
+ export declare const romanian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/russian.d.ts
3
- declare const russian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { russian };
3
+ export declare const russian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/schinese.d.ts
3
- declare const schinese: CS2ItemTranslationMap;
4
- //#endregion
5
- export { schinese };
3
+ export declare const schinese: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/spanish.d.ts
3
- declare const spanish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { spanish };
3
+ export declare const spanish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/swedish.d.ts
3
- declare const swedish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { swedish };
3
+ export declare const swedish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/tchinese.d.ts
3
- declare const tchinese: CS2ItemTranslationMap;
4
- //#endregion
5
- export { tchinese };
3
+ export declare const tchinese: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/thai.d.ts
3
- declare const thai: CS2ItemTranslationMap;
4
- //#endregion
5
- export { thai };
3
+ export declare const thai: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/turkish.d.ts
3
- declare const turkish: CS2ItemTranslationMap;
4
- //#endregion
5
- export { turkish };
3
+ export declare const turkish: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/ukrainian.d.ts
3
- declare const ukrainian: CS2ItemTranslationMap;
4
- //#endregion
5
- export { ukrainian };
3
+ export declare const ukrainian: CS2ItemTranslationMap;
4
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CS2ItemTranslationMap } from "../economy-types.mjs";
2
2
  //#region src/translations/vietnamese.d.ts
3
- declare const vietnamese: CS2ItemTranslationMap;
4
- //#endregion
5
- export { vietnamese };
3
+ export declare const vietnamese: CS2ItemTranslationMap;
4
+ //#endregion
package/dist/utils.d.mts CHANGED
@@ -1,19 +1,18 @@
1
1
  //#region src/utils.d.ts
2
- type EnumValues<T> = T[keyof T];
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; };
4
- type MapValue<T> = T extends Map<any, infer I> ? I : never;
5
- type RecordValue<T> = T extends Record<any, infer I> ? I : never;
6
- declare function compare<T, U>(var1: T, var2: U): boolean;
7
- declare function float(literal: number, fractionDigits?: number): number;
8
- declare function clamp(value: number, min: number, max: number): number;
9
- declare function countDecimals(value: number): number;
10
- declare function isFactorPrecise(value: number, factor: number): boolean;
11
- declare function truncateToFactor(value: number, factor: number): number;
12
- declare function roundToFactor(value: number, factor: number): number;
13
- declare function ensure<T>(value: T, message?: string): NonNullable<T> & {};
14
- declare function safe<T>(fn: () => T): false | T;
15
- declare function assert(condition: any, message?: string): asserts condition;
16
- declare function fail(message?: string): never;
17
- declare function isNotUndefined<T>(value: T): value is NonNullable<T>;
18
- //#endregion
19
- export { EnumValues, Interface, MapValue, RecordValue, assert, clamp, compare, countDecimals, ensure, fail, float, isFactorPrecise, isNotUndefined, roundToFactor, safe, truncateToFactor };
2
+ export type EnumValues<T> = T[keyof T];
3
+ export 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; };
4
+ export type MapValue<T> = T extends Map<any, infer I> ? I : never;
5
+ export type RecordValue<T> = T extends Record<any, infer I> ? I : never;
6
+ export declare function compare<T, U>(var1: T, var2: U): boolean;
7
+ export declare function float(literal: number, fractionDigits?: number): number;
8
+ export declare function clamp(value: number, min: number, max: number): number;
9
+ export declare function countDecimals(value: number): number;
10
+ export declare function isFactorPrecise(value: number, factor: number): boolean;
11
+ export declare function truncateToFactor(value: number, factor: number): number;
12
+ export declare function roundToFactor(value: number, factor: number): number;
13
+ export declare function ensure<T>(value: T, message?: string): NonNullable<T> & {};
14
+ export declare function safe<T>(fn: () => T): false | T;
15
+ export declare function assert(condition: any, message?: string): asserts condition;
16
+ export declare function fail(message?: string): never;
17
+ export declare function isNotUndefined<T>(value: T): value is NonNullable<T>;
18
+ //#endregion
package/dist/veto.d.mts CHANGED
@@ -1,31 +1,31 @@
1
1
  import { EnumValues } from "./utils.mjs";
2
2
  import { CS2Map } from "./maps.mjs";
3
3
  //#region src/veto.d.ts
4
- declare const CS2VetoAction: {
4
+ export declare const CS2VetoAction: {
5
5
  readonly Pick: 1;
6
6
  readonly Ban: 2;
7
7
  };
8
- type CS2VetoAction = EnumValues<typeof CS2VetoAction>;
9
- declare const CS2VetoType: {
8
+ export type CS2VetoAction = EnumValues<typeof CS2VetoAction>;
9
+ export declare const CS2VetoType: {
10
10
  readonly BO1: "bo1";
11
11
  readonly BO2: "bo2";
12
12
  readonly BO3: "bo3";
13
13
  readonly BO5: "bo5";
14
14
  readonly Custom: "custom";
15
15
  };
16
- type CS2VetoType = EnumValues<typeof CS2VetoType>;
17
- type CS2VetoTeam = 0 | 1;
18
- interface CS2VetoMap {
16
+ export type CS2VetoType = EnumValues<typeof CS2VetoType>;
17
+ export type CS2VetoTeam = 0 | 1;
18
+ export interface CS2VetoMap {
19
19
  action?: CS2VetoAction;
20
20
  mapname: string;
21
21
  team?: CS2VetoTeam;
22
22
  }
23
- interface CS2VetoEvent {
23
+ export interface CS2VetoEvent {
24
24
  action?: CS2VetoAction;
25
25
  mapname: string;
26
26
  team?: CS2VetoTeam;
27
27
  }
28
- declare class CS2Veto {
28
+ export declare class CS2Veto {
29
29
  private actions;
30
30
  private history;
31
31
  private maps;
@@ -44,5 +44,4 @@ declare class CS2Veto {
44
44
  choose(mapname: string): boolean;
45
45
  random(): boolean;
46
46
  }
47
- //#endregion
48
- export { CS2Veto, CS2VetoAction, CS2VetoEvent, CS2VetoMap, CS2VetoTeam, CS2VetoType };
47
+ //#endregion
package/package.json CHANGED
@@ -59,10 +59,10 @@
59
59
  "meshoptimizer": "1.2.0",
60
60
  "prettier": "3.9.6",
61
61
  "rolldown": "^1.1.4",
62
- "rolldown-plugin-dts": "^0.28.0",
62
+ "rolldown-plugin-dts": "^0.28.2",
63
63
  "rollup-plugin-delete": "^3.0.2",
64
64
  "sharp": "0.35.3",
65
- "tsx": "^4.23.11",
65
+ "tsx": "^4.23.12",
66
66
  "typedoc": "^0.28.20",
67
67
  "typescript": "^6.0.3",
68
68
  "vitest": "^4.1.10"
@@ -70,5 +70,5 @@
70
70
  "engines": {
71
71
  "node": ">=20"
72
72
  },
73
- "version": "9.1.0-rc.2"
73
+ "version": "9.1.0"
74
74
  }