@tosuapp/osu-native-wrapper 1.0.1 → 1.0.3

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/dist/index.cjs CHANGED
@@ -564,6 +564,14 @@ function makeScoreInfo(input) {
564
564
  score.rulesetHandle = input.ruleset.handle;
565
565
  score.beatmapHandle = input.beatmap.handle;
566
566
  score.modsHandle = input.mods?.handle ?? OsuNative.makeNullHandle();
567
+ const nullableScore = new import_osu_native_napi10.Cabinet__Nullable_int64_t();
568
+ if (input.legacyScore !== 0) {
569
+ nullableScore.hasValue = true;
570
+ nullableScore.value = input.legacyScore;
571
+ score.legacyTotalScore = nullableScore;
572
+ } else {
573
+ nullableScore.hasValue = false;
574
+ }
567
575
  score.maxCombo = input.maxCombo ?? 0;
568
576
  score.accuracy = input.accuracy ?? 0;
569
577
  score.countMiss = input.countMiss ?? 0;
package/dist/index.d.mts CHANGED
@@ -121,6 +121,7 @@ type ScoreInfoInput = Partial<Omit<NativeScoreInfo, "rulesetHandle" | "beatmapHa
121
121
  ruleset: Ruleset;
122
122
  beatmap: Beatmap;
123
123
  mods?: ModsCollection | null;
124
+ legacyScore: number;
124
125
  };
125
126
 
126
127
  declare class CatchPerformanceCalculator extends NativeHandleOwner<NativeCatchPerformanceCalculator> {
package/dist/index.d.ts CHANGED
@@ -121,6 +121,7 @@ type ScoreInfoInput = Partial<Omit<NativeScoreInfo, "rulesetHandle" | "beatmapHa
121
121
  ruleset: Ruleset;
122
122
  beatmap: Beatmap;
123
123
  mods?: ModsCollection | null;
124
+ legacyScore: number;
124
125
  };
125
126
 
126
127
  declare class CatchPerformanceCalculator extends NativeHandleOwner<NativeCatchPerformanceCalculator> {
package/dist/index.mjs CHANGED
@@ -509,12 +509,20 @@ var TaikoDifficultyCalculator = _TaikoDifficultyCalculator;
509
509
  import raw11 from "@tosuapp/osu-native-napi";
510
510
 
511
511
  // src/internal/scoreInfo.ts
512
- import raw10 from "@tosuapp/osu-native-napi";
512
+ import raw10, { Cabinet__Nullable_int64_t } from "@tosuapp/osu-native-napi";
513
513
  function makeScoreInfo(input) {
514
514
  const score = new raw10.NativeScoreInfo();
515
515
  score.rulesetHandle = input.ruleset.handle;
516
516
  score.beatmapHandle = input.beatmap.handle;
517
517
  score.modsHandle = input.mods?.handle ?? OsuNative.makeNullHandle();
518
+ const nullableScore = new Cabinet__Nullable_int64_t();
519
+ if (input.legacyScore !== 0) {
520
+ nullableScore.hasValue = true;
521
+ nullableScore.value = input.legacyScore;
522
+ score.legacyTotalScore = nullableScore;
523
+ } else {
524
+ nullableScore.hasValue = false;
525
+ }
518
526
  score.maxCombo = input.maxCombo ?? 0;
519
527
  score.accuracy = input.accuracy ?? 0;
520
528
  score.countMiss = input.countMiss ?? 0;
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "@tosuapp/osu-native-wrapper",
3
- "version": "1.0.1",
4
- "type": "commonjs",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "require": "./dist/index.cjs",
12
- "import": "./dist/index.mjs"
13
- }
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "scripts": {
19
- "dev": "tsx examples/usage.ts",
20
- "build": "tsup",
21
- "prepack": "pnpm run build"
22
- },
23
- "dependencies": {
24
- "@tosuapp/osu-native-napi": "1.0.0"
25
- },
26
- "devDependencies": {
27
- "@swc/core": "^1.15.11",
28
- "@types/node": "^20.11.1",
29
- "tsup": "^8.5.0",
30
- "tsx": "^4.21.0",
31
- "typescript": "^5.9.3"
32
- }
33
- }
1
+ {
2
+ "name": "@tosuapp/osu-native-wrapper",
3
+ "version": "1.0.3",
4
+ "type": "commonjs",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "require": "./dist/index.cjs",
12
+ "import": "./dist/index.mjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "dev": "tsx examples/usage.ts",
20
+ "build": "tsup",
21
+ "prepack": "pnpm run build"
22
+ },
23
+ "dependencies": {
24
+ "@tosuapp/osu-native-napi": "1.0.1"
25
+ },
26
+ "devDependencies": {
27
+ "@swc/core": "^1.15.11",
28
+ "@types/node": "^20.11.1",
29
+ "tsup": "^8.5.0",
30
+ "tsx": "^4.21.0",
31
+ "typescript": "^5.9.3"
32
+ }
33
+ }