@types/gimloader 1.6.0 → 1.8.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.
gimloader/README.md CHANGED
@@ -8,8 +8,8 @@ This package contains type definitions for gimloader (https://github.com/Gimload
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gimloader.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 12 Sep 2025 19:32:39 GMT
11
+ * Last updated: Sat, 27 Sep 2025 00:04:05 GMT
12
12
  * Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/react-dom](https://npmjs.com/package/@types/react-dom)
13
13
 
14
14
  # Credits
15
- These definitions were written by [TheLazySquid](https://github.com/TheLazySquid).
15
+ These definitions were written by [TheLazySquid](https://github.com/TheLazySquid), and [Riptide](https://github.com/RiptideAtlantic).
gimloader/index.d.ts CHANGED
@@ -188,6 +188,7 @@ declare namespace Gimloader {
188
188
  needsLib: string[];
189
189
  optionalLib: string[];
190
190
  syncEval: string;
191
+ gamemode: string[];
191
192
  hasSettings: string;
192
193
  };
193
194
  /** Gets the exported values of a plugin, if it has been enabled */
@@ -219,6 +220,7 @@ declare namespace Gimloader {
219
220
  needsLib: string[];
220
221
  optionalLib: string[];
221
222
  syncEval: string;
223
+ gamemode: string[];
222
224
  hasSettings: string;
223
225
  };
224
226
  /** Gets the exported values of a library */
@@ -298,7 +300,8 @@ declare namespace Gimloader {
298
300
 
299
301
  type PatcherInsteadCallback = (thisVal: any, args: IArguments) => void;
300
302
 
301
- type PatcherBeforeCallback = (thisVal: any, args: IArguments) => boolean | undefined;
303
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
304
+ type PatcherBeforeCallback = (thisVal: any, args: IArguments) => boolean | void;
302
305
 
303
306
  type PatcherAfterCallback = (thisVal: any, args: IArguments, returnVal: any) => any;
304
307
 
@@ -371,7 +374,8 @@ declare namespace Gimloader {
371
374
  interface ModalButton {
372
375
  text: string;
373
376
  style?: "primary" | "danger" | "close";
374
- onClick?: (event: MouseEvent) => boolean | undefined;
377
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
378
+ onClick?: (event: MouseEvent) => boolean | void;
375
379
  }
376
380
 
377
381
  interface ModalOptions {
@@ -401,12 +405,14 @@ declare namespace Gimloader {
401
405
 
402
406
  class ScopedNetApi extends BaseNetApi {
403
407
  private readonly id;
404
- constructor(id: string);
408
+ private readonly defaultGamemode;
409
+ constructor(id: string, defaultGamemode: string[]);
405
410
  /**
406
- * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded
411
+ * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded.
412
+ * If the \@gamemode header is set the callback will only fire if the gamemode matches one of the provided gamemodes.
407
413
  * @returns A function to cancel waiting for load
408
414
  */
409
- onLoad(callback: (type: ConnectionType) => void): () => void;
415
+ onLoad(callback: (type: ConnectionType, gamemode: string) => void, gamemode?: string | string[]): () => void;
410
416
  }
411
417
 
412
418
  type ConnectionType = "None" | "Colyseus" | "Blueboat";
@@ -415,6 +421,8 @@ declare namespace Gimloader {
415
421
  constructor();
416
422
  /** Which type of server the client is currently connected to */
417
423
  get type(): ConnectionType;
424
+ /** The id of the gamemode the player is currently playing */
425
+ get gamemode(): string;
418
426
  /** The room that the client is connected to, or null if there is no connection */
419
427
  get room(): any;
420
428
  /** Whether the user is the one hosting the current game */
@@ -429,7 +437,11 @@ declare namespace Gimloader {
429
437
  * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded
430
438
  * @returns A function to cancel waiting for load
431
439
  */
432
- onLoad(id: string, callback: (type: ConnectionType) => void): () => void;
440
+ onLoad(
441
+ id: string,
442
+ callback: (type: ConnectionType, gamemode: string) => void,
443
+ gamemode?: string | string[],
444
+ ): () => void;
433
445
  /** Cancels any calls to {@link onLoad} with the same id */
434
446
  offLoad(id: string): void;
435
447
  /**
gimloader/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/gimloader",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "TypeScript definitions for gimloader",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gimloader",
6
6
  "license": "MIT",
@@ -9,6 +9,11 @@
9
9
  "name": "TheLazySquid",
10
10
  "githubUsername": "TheLazySquid",
11
11
  "url": "https://github.com/TheLazySquid"
12
+ },
13
+ {
14
+ "name": "Riptide",
15
+ "githubUsername": "RiptideAtlantic",
16
+ "url": "https://github.com/RiptideAtlantic"
12
17
  }
13
18
  ],
14
19
  "main": "",
@@ -24,6 +29,6 @@
24
29
  "@types/react-dom": "*"
25
30
  },
26
31
  "peerDependencies": {},
27
- "typesPublisherContentHash": "d804a544bedef771c8985233d4e23a8bfcfadafa34060303ba20e3dbe79b51f8",
32
+ "typesPublisherContentHash": "a67d9d9aae3c87258dd2d26a5f4df0f9d9a0a8520f5614c841acad4b70b8f569",
28
33
  "typeScriptVersion": "5.2"
29
34
  }