@types/gimloader 1.8.2 → 1.9.1

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,7 +8,7 @@ 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: Tue, 21 Oct 2025 22:34:08 GMT
11
+ * Last updated: Thu, 13 Nov 2025 13:12:01 GMT
12
12
  * Dependencies: [@dimforge/rapier2d-compat](https://npmjs.com/package/@dimforge/rapier2d-compat), [@types/react](https://npmjs.com/package/@types/react), [@types/react-dom](https://npmjs.com/package/@types/react-dom), [eventemitter2](https://npmjs.com/package/eventemitter2), [phaser](https://npmjs.com/package/phaser)
13
13
 
14
14
  # Credits
gimloader/index.d.ts CHANGED
@@ -452,6 +452,8 @@ declare global {
452
452
  setCanInteractThroughColliders(canInteract: boolean): void;
453
453
  setForceDisabled(forceDisabled: boolean): void;
454
454
  setInfo(info: any): void;
455
+ remove(zone: CircleShort | Rect): void;
456
+ onInteraction?(): void;
455
457
  }
456
458
 
457
459
  interface DeviceInput {
@@ -515,6 +517,11 @@ declare global {
515
517
  update(): void;
516
518
  }
517
519
 
520
+ interface SkinSetupOptions extends SkinOptions {
521
+ x?: number;
522
+ y?: number;
523
+ }
524
+
518
525
  interface SkinOptions {
519
526
  id: string;
520
527
  editStyles?: Record<string, string>;
@@ -527,7 +534,7 @@ declare global {
527
534
  scene: Scene;
528
535
  skinId: string;
529
536
  applyEditStyles(options: SkinOptions): void;
530
- setupSkin(position: Vector): void;
537
+ setupSkin(position: SkinSetupOptions): void;
531
538
  updateSkin(options: SkinOptions): void;
532
539
  }
533
540
 
@@ -1077,6 +1084,8 @@ declare global {
1077
1084
  device: Device;
1078
1085
  scene: Scene;
1079
1086
  angle: number;
1087
+ x: number;
1088
+ y: number;
1080
1089
  } & Partial<RectShort & CircleShort & Ellipse>;
1081
1090
 
1082
1091
  interface ColliderEntry {
@@ -2110,6 +2119,118 @@ declare global {
2110
2119
  }
2111
2120
  }
2112
2121
 
2122
+ type SettingsChangeCallback = (value: any, remote: boolean) => void;
2123
+
2124
+ interface CustomSection {
2125
+ type: "customsection";
2126
+ id: string;
2127
+ default?: any;
2128
+ onChange?: (value: any, remote: boolean) => void;
2129
+ render: (
2130
+ container: HTMLElement,
2131
+ currentValue: any,
2132
+ onChange: (newValue: any) => void,
2133
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2134
+ ) => (() => void) | void;
2135
+ }
2136
+
2137
+ interface CustomSetting extends BaseSetting<any> {
2138
+ type: "custom";
2139
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2140
+ render: (container: HTMLElement, currentValue: any, update: (newValue: any) => void) => (() => void) | void;
2141
+ }
2142
+
2143
+ interface ColorSetting extends BaseSetting<string> {
2144
+ type: "color";
2145
+ rgba?: boolean;
2146
+ }
2147
+
2148
+ interface RadioSetting extends BaseSetting<string> {
2149
+ type: "radio";
2150
+ options: {
2151
+ label: string;
2152
+ value: string;
2153
+ }[];
2154
+ }
2155
+
2156
+ interface SliderSetting extends BaseSetting<number> {
2157
+ type: "slider";
2158
+ min: number;
2159
+ max: number;
2160
+ step?: number;
2161
+ ticks?: number[];
2162
+ formatter?: (value: number) => string;
2163
+ }
2164
+
2165
+ interface TextSetting extends BaseSetting<string> {
2166
+ type: "text";
2167
+ placeholder?: string;
2168
+ maxLength?: number;
2169
+ }
2170
+
2171
+ interface ToggleSetting extends BaseSetting<boolean> {
2172
+ type: "toggle";
2173
+ }
2174
+
2175
+ interface NumberSetting extends BaseSetting<number> {
2176
+ type: "number";
2177
+ min?: number;
2178
+ max?: number;
2179
+ step?: number;
2180
+ }
2181
+
2182
+ interface MultiselectSetting extends BaseSetting<string[]> {
2183
+ type: "multiselect";
2184
+ options: {
2185
+ label: string;
2186
+ value: string;
2187
+ }[];
2188
+ }
2189
+
2190
+ interface BaseSetting<T> {
2191
+ id: string;
2192
+ default?: T;
2193
+ title: string;
2194
+ description?: string;
2195
+ onChange?: (value: T, remote: boolean) => void;
2196
+ }
2197
+
2198
+ interface DropdownSetting extends BaseSetting<string> {
2199
+ type: "dropdown";
2200
+ options: {
2201
+ label: string;
2202
+ value: string;
2203
+ }[];
2204
+ allowNone?: boolean;
2205
+ }
2206
+
2207
+ type PluginSetting =
2208
+ | DropdownSetting
2209
+ | MultiselectSetting
2210
+ | NumberSetting
2211
+ | ToggleSetting
2212
+ | TextSetting
2213
+ | SliderSetting
2214
+ | RadioSetting
2215
+ | ColorSetting
2216
+ | CustomSetting
2217
+ | CustomSection;
2218
+
2219
+ interface SettingGroup {
2220
+ type: "group";
2221
+ title: string;
2222
+ settings: PluginSetting[];
2223
+ }
2224
+
2225
+ type PluginSettingsDescription = (PluginSetting | SettingGroup)[];
2226
+
2227
+ interface SettingsMethods {
2228
+ create: (description: PluginSettingsDescription) => void;
2229
+ listen: (key: string, callback: SettingsChangeCallback) => () => void;
2230
+ }
2231
+
2232
+ type PluginSettings = SettingsMethods & Record<string, any>;
2233
+
2113
2234
  class PluginsApi {
2114
2235
  /** A list of all the plugins installed */
2115
2236
  get list(): string[];
@@ -2127,8 +2248,9 @@ declare global {
2127
2248
  webpage: string | null;
2128
2249
  needsLib: string[];
2129
2250
  optionalLib: string[];
2130
- syncEval: string;
2251
+ deprecated: string | null;
2131
2252
  gamemode: string[];
2253
+ changelog: string[];
2132
2254
  hasSettings: string;
2133
2255
  };
2134
2256
  /** Gets the exported values of a plugin, if it has been enabled */
@@ -2159,8 +2281,9 @@ declare global {
2159
2281
  webpage: string | null;
2160
2282
  needsLib: string[];
2161
2283
  optionalLib: string[];
2162
- syncEval: string;
2284
+ deprecated: string | null;
2163
2285
  gamemode: string[];
2286
+ changelog: string[];
2164
2287
  hasSettings: string;
2165
2288
  };
2166
2289
  /** Gets the exported values of a library */
@@ -2354,6 +2477,10 @@ declare global {
2354
2477
  callback: (type: ConnectionType, gamemode: string) => void,
2355
2478
  gamemode?: string | string[],
2356
2479
  ): () => void;
2480
+ /** Runs a callback when a request is made that matches a certain path (can have wildcards) */
2481
+ modifyFetchRequest(path: string, callback: (options: RequesterOptions) => any): () => void;
2482
+ /** Runs a callback when a response is recieved for a request under a certain path (can have wildcards) */
2483
+ modifyFetchResponse(path: string, callback: (response: any) => any): () => void;
2357
2484
  }
2358
2485
 
2359
2486
  type ConnectionType = "None" | "Colyseus" | "Blueboat";
@@ -2372,6 +2499,16 @@ declare global {
2372
2499
  send(channel: string, message: any): void;
2373
2500
  }
2374
2501
 
2502
+ interface RequesterOptions {
2503
+ url: string;
2504
+ method?: string;
2505
+ data?: any;
2506
+ cacheKey?: string;
2507
+ success?: (response: any, cached: boolean) => void;
2508
+ both?: () => void;
2509
+ error?: (error: any) => void;
2510
+ }
2511
+
2375
2512
  interface NetApi extends BaseNetApi {
2376
2513
  new(): this;
2377
2514
  /**
@@ -2385,6 +2522,14 @@ declare global {
2385
2522
  ): () => void;
2386
2523
  /** Cancels any calls to {@link onLoad} with the same id */
2387
2524
  offLoad(id: string): void;
2525
+ /** Runs a callback when a request is made that matches a certain path (can have wildcards) */
2526
+ modifyFetchRequest(id: string, path: string, callback: (options: RequesterOptions) => any): () => void;
2527
+ /** Runs a callback when a response is recieved for a request under a certain path (can have wildcards) */
2528
+ modifyFetchResponse(id: string, path: string, callback: (response: any) => any): () => void;
2529
+ /** Stops any modifications made by {@link modifyFetchRequest} with the same id */
2530
+ stopModifyRequest(id: string): void;
2531
+ /** Stops any modifications made by {@link modifyFetchResponse} with the same id */
2532
+ stopModifyResponse(id: string): void;
2388
2533
  /**
2389
2534
  * @deprecated Methods for both transports are now on the base net api
2390
2535
  * @hidden
@@ -2653,6 +2798,8 @@ declare global {
2653
2798
  storage: Readonly<ScopedStorageApi>;
2654
2799
  /** Functions for intercepting the arguments and return values of functions */
2655
2800
  patcher: Readonly<ScopedPatcherApi>;
2801
+ /** A utility for creating persistent settings menus, only available to plugins */
2802
+ settings: PluginSettings;
2656
2803
  /** Methods for getting info on libraries */
2657
2804
  libs: Readonly<LibsApi>;
2658
2805
  /** Gets the exported values of a library */
gimloader/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/gimloader",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "TypeScript definitions for gimloader",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gimloader",
6
6
  "license": "MIT",
@@ -32,6 +32,6 @@
32
32
  "eventemitter2": "~6.4.9"
33
33
  },
34
34
  "peerDependencies": {},
35
- "typesPublisherContentHash": "00185cb0abd4d14a410df466c7eeef441bb7b6494c9e50ffe82655f048731fc6",
35
+ "typesPublisherContentHash": "4afe930213069b4124381dc798d078235746605f68835e02486279102b33a6ab",
36
36
  "typeScriptVersion": "5.2"
37
37
  }