Skip to content

Some typings are incorrect #27

Description

@cory2067

I noticed some issues in index.d.ts that I noticed when integrating node-osu with a typescript project

  1. MultiplayerScore is missing types
  2. Some types are Number but should be number
  3. Types assume that parseNumeric is true, because the numeric fields are always number. However, if parseNumeric is false (the default), then those types are wrong.

To resolve 1 and 2 for my use case, I applied the following patch locally:

diff --git a/node_modules/node-osu/index.d.ts b/node_modules/node-osu/index.d.ts
index 0c587eb..317386a 100644
--- a/node_modules/node-osu/index.d.ts
+++ b/node_modules/node-osu/index.d.ts
@@ -218,8 +218,23 @@ export class Game {
 }
 
 export class MultiplayerScore {
-    constructor(...args: any[]);
-
+    slot: number;
+    team: string;
+    userId: string;
+    score: number;
+    maxCombo: string;
+    counts: {
+        '300': number,
+        '100': number,
+        '50': number,
+        'geki': number,
+        'katu': number,
+        'miss': number
+    }
+    perfect: boolean;
+    pass: boolean;
+    raw_mods: number;
+    mods: string[];
 }
 
 export class Score {
@@ -274,9 +289,9 @@ export class User {
         total: number;
     };
     pp: {
-        raw: Number,
-        rank: Number,
-        countryRank: Number
+        raw: number,
+        rank: number,
+        countryRank: number
     };
     country: string;
     level: number;

This issue body was partially generated by patch-package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions