@types/gimloader 1.9.1 → 1.10.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: Thu, 13 Nov 2025 13:12:01 GMT
11
+ * Last updated: Tue, 30 Dec 2025 21:02:09 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
@@ -421,7 +421,7 @@ declare global {
421
421
  onChange(value: RotatedRect): void;
422
422
  }
423
423
 
424
- interface VisualEditing {
424
+ interface DeviceVisualEditing {
425
425
  add: {
426
426
  box(options: VisualEditingBox): void;
427
427
  circle(options: VisualEditingCircle): void;
@@ -969,7 +969,8 @@ declare global {
969
969
  }
970
970
 
971
971
  interface Jump {
972
- actuallyJumped: boolean;
972
+ /** Optional in top-down, required in platformer */
973
+ actuallyJumped?: boolean;
973
974
  isJumping: boolean;
974
975
  jumpCounter: number;
975
976
  jumpTicks: number;
@@ -1150,7 +1151,7 @@ declare global {
1150
1151
  id: string;
1151
1152
  scene: Scene;
1152
1153
  deviceOption: DeviceOption;
1153
- visualEditing: VisualEditing;
1154
+ visualEditing: DeviceVisualEditing;
1154
1155
  shadows: Shadows;
1155
1156
  input: DeviceInput;
1156
1157
  parts: any;
@@ -1276,7 +1277,7 @@ declare global {
1276
1277
  }
1277
1278
 
1278
1279
  interface Keyboard {
1279
- heldKeys: Set<string>;
1280
+ heldKeys: Set<number>;
1280
1281
  scene: Scene;
1281
1282
  state: KeyboardState;
1282
1283
  createListeners(): void;
@@ -1391,7 +1392,10 @@ declare global {
1391
1392
  }
1392
1393
 
1393
1394
  interface EditingStore {
1394
- accessPoints: Map<any, any>;
1395
+ accessPoints: Map<string, {
1396
+ name: string;
1397
+ position: Vector;
1398
+ }>;
1395
1399
  gridSnap: number;
1396
1400
  showMemoryBarAtAllTimes: boolean;
1397
1401
  }
@@ -1638,7 +1642,7 @@ declare global {
1638
1642
  id: string;
1639
1643
  position: string;
1640
1644
  text: string;
1641
- trackedItemId: any;
1645
+ trackedItemId: string | null;
1642
1646
  showTrackedItemMaximumAmount: boolean;
1643
1647
  type: string;
1644
1648
  priority: number;
@@ -1687,13 +1691,38 @@ declare global {
1687
1691
  removing: boolean;
1688
1692
  }
1689
1693
 
1694
+ interface Widget {
1695
+ type: string;
1696
+ id: string;
1697
+ y: number;
1698
+ placement: string;
1699
+ statName: string;
1700
+ statValue: number;
1701
+ }
1702
+
1703
+ interface CallToActionItem {
1704
+ id: string;
1705
+ category: string;
1706
+ name: string;
1707
+ url: string;
1708
+ }
1709
+
1710
+ interface CallToActionCategory {
1711
+ id: string;
1712
+ name: string;
1713
+ plural: string;
1714
+ }
1715
+
1690
1716
  interface GameSession {
1691
- callToAction: any;
1717
+ callToAction: {
1718
+ categories: CallToActionCategory[];
1719
+ items: CallToActionItem[];
1720
+ };
1692
1721
  countdownEnd: number;
1693
1722
  phase: string;
1694
1723
  resultsEnd: number;
1695
1724
  widgets: {
1696
- widgets: any[];
1725
+ widgets: Widget[];
1697
1726
  };
1698
1727
  }
1699
1728
 
@@ -1847,6 +1876,26 @@ declare global {
1847
1876
  topDownControlsActive: boolean;
1848
1877
  }
1849
1878
 
1879
+ interface VisualEditing {
1880
+ active: boolean;
1881
+ cursor: string;
1882
+ id: string;
1883
+ instruction: string;
1884
+ keyboardHelpers: {
1885
+ trigger: string;
1886
+ action: string;
1887
+ }[];
1888
+ }
1889
+
1890
+ interface SortingState {
1891
+ depth: number;
1892
+ deviceId: string;
1893
+ deviceName: string;
1894
+ globalDepth: number;
1895
+ layer: string;
1896
+ y: number;
1897
+ }
1898
+
1850
1899
  interface CurrentlyEditedDevice {
1851
1900
  deviceOptionId: string;
1852
1901
  id: string;
@@ -1857,9 +1906,9 @@ declare global {
1857
1906
  currentlyEditedGridId: string;
1858
1907
  currentlySortedDeviceId: string;
1859
1908
  screen: string;
1860
- sortingState: any[];
1909
+ sortingState: SortingState[];
1861
1910
  usingMultiselect: boolean;
1862
- visualEditing: any;
1911
+ visualEditing: VisualEditing;
1863
1912
  }
1864
1913
 
1865
1914
  interface Editing {
@@ -1873,7 +1922,7 @@ declare global {
1873
1922
  interface MeDeviceUI {
1874
1923
  current: {
1875
1924
  deviceId: string;
1876
- props: any;
1925
+ props: Record<string, any>;
1877
1926
  };
1878
1927
  desiredOpenDeviceId?: string;
1879
1928
  serverVersionOpenDeviceId: string;
@@ -2026,6 +2075,11 @@ declare global {
2026
2075
  items: Map<string, CodeGridItem>;
2027
2076
  }
2028
2077
 
2078
+ interface WireConnection {
2079
+ id: string;
2080
+ name: string;
2081
+ }
2082
+
2029
2083
  interface CodeGridSchema {
2030
2084
  allowChannelGrids: boolean;
2031
2085
  customBlocks: any[];
@@ -2034,12 +2088,28 @@ declare global {
2034
2088
 
2035
2089
  interface DeviceOption {
2036
2090
  codeGridSchema: CodeGridSchema;
2037
- defaultState: any;
2091
+ defaultState: Record<string, any>;
2092
+ description?: string;
2038
2093
  id: string;
2094
+ initialMemoryCost?: number;
2095
+ maxOnMap?: number;
2096
+ maximumRoleLevel?: number;
2097
+ minimumRoleLevel?: number;
2098
+ name?: string;
2039
2099
  optionSchema: {
2040
2100
  options: any[];
2041
2101
  };
2042
- wireConfig: any;
2102
+ seasonTicketRequired?: boolean;
2103
+ subsequentMemoryCost?: number;
2104
+ supportedMapStyles?: string[];
2105
+ wireConfig: {
2106
+ in: {
2107
+ connections: WireConnection[];
2108
+ };
2109
+ out: {
2110
+ connections: WireConnection[];
2111
+ };
2112
+ };
2043
2113
  }
2044
2114
 
2045
2115
  interface DeviceData {
@@ -2121,23 +2191,19 @@ declare global {
2121
2191
 
2122
2192
  type SettingsChangeCallback = (value: any, remote: boolean) => void;
2123
2193
 
2124
- interface CustomSection {
2194
+ interface CustomSection<T = any> {
2125
2195
  type: "customsection";
2126
2196
  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;
2197
+ default?: T;
2198
+ onChange?: (value: T, remote: boolean) => void;
2199
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2200
+ render: (container: HTMLElement, currentValue: T, onChange: (newValue: T) => void) => (() => void) | void;
2135
2201
  }
2136
2202
 
2137
- interface CustomSetting extends BaseSetting<any> {
2203
+ interface CustomSetting<T = any> extends BaseSetting<T> {
2138
2204
  type: "custom";
2139
2205
  // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2140
- render: (container: HTMLElement, currentValue: any, update: (newValue: any) => void) => (() => void) | void;
2206
+ render: (container: HTMLElement, currentValue: T, update: (newValue: T) => void) => (() => void) | void;
2141
2207
  }
2142
2208
 
2143
2209
  interface ColorSetting extends BaseSetting<string> {
@@ -2226,7 +2292,7 @@ declare global {
2226
2292
 
2227
2293
  interface SettingsMethods {
2228
2294
  create: (description: PluginSettingsDescription) => void;
2229
- listen: (key: string, callback: SettingsChangeCallback) => () => void;
2295
+ listen: (key: string, callback: SettingsChangeCallback, immediate?: boolean) => () => void;
2230
2296
  }
2231
2297
 
2232
2298
  type PluginSettings = SettingsMethods & Record<string, any>;
@@ -2237,24 +2303,9 @@ declare global {
2237
2303
  /** Whether a plugin exists and is enabled */
2238
2304
  isEnabled(name: string): boolean;
2239
2305
  /** Gets the headers of a plugin, such as version, author, and description */
2240
- getHeaders(name: string): {
2241
- name: string;
2242
- description: string;
2243
- author: string;
2244
- version: string | null;
2245
- reloadRequired: string;
2246
- isLibrary: string;
2247
- downloadUrl: string | null;
2248
- webpage: string | null;
2249
- needsLib: string[];
2250
- optionalLib: string[];
2251
- deprecated: string | null;
2252
- gamemode: string[];
2253
- changelog: string[];
2254
- hasSettings: string;
2255
- };
2306
+ getHeaders(name: string): ScriptHeaders;
2256
2307
  /** Gets the exported values of a plugin, if it has been enabled */
2257
- get(name: string): any;
2308
+ get<T extends keyof Gimloader.Plugins>(name: T): Gimloader.Plugins[T];
2258
2309
  /**
2259
2310
  * @deprecated Use {@link get} instead
2260
2311
  * @hidden
@@ -2264,30 +2315,83 @@ declare global {
2264
2315
  };
2265
2316
  }
2266
2317
 
2318
+ interface ScriptHeaders {
2319
+ name: string;
2320
+ description: string;
2321
+ author: string;
2322
+ version: string | null;
2323
+ reloadRequired: string;
2324
+ isLibrary: string;
2325
+ downloadUrl: string | null;
2326
+ webpage: string | null;
2327
+ needsLib: string[];
2328
+ optionalLib: string[];
2329
+ deprecated: string | null;
2330
+ gamemode: string[];
2331
+ changelog: string[];
2332
+ /** Only available for plugins */
2333
+ needsPlugin: string[];
2334
+ hasSettings: string;
2335
+ }
2336
+
2267
2337
  class LibsApi {
2268
2338
  /** A list of all the libraries installed */
2269
2339
  get list(): string[];
2270
2340
  /** Gets whether or not a plugin is installed and enabled */
2271
2341
  isEnabled(name: string): boolean;
2272
2342
  /** Gets the headers of a library, such as version, author, and description */
2273
- getHeaders(name: string): {
2274
- name: string;
2275
- description: string;
2276
- author: string;
2277
- version: string | null;
2278
- reloadRequired: string;
2279
- isLibrary: string;
2280
- downloadUrl: string | null;
2281
- webpage: string | null;
2282
- needsLib: string[];
2283
- optionalLib: string[];
2284
- deprecated: string | null;
2285
- gamemode: string[];
2286
- changelog: string[];
2287
- hasSettings: string;
2288
- };
2343
+ getHeaders(name: string): ScriptHeaders;
2289
2344
  /** Gets the exported values of a library */
2290
- get(name: string): any;
2345
+ get<T extends keyof Gimloader.Libraries>(name: T): Gimloader.Libraries[T];
2346
+ }
2347
+
2348
+ class ScopedCommandsApi {
2349
+ private readonly id;
2350
+ constructor(id: string);
2351
+ /** Adds a command to the user's command palette. Can request additional input within the callback. */
2352
+ addCommand(options: CommandOptions, callback: CommandCallback): () => void;
2353
+ }
2354
+
2355
+ interface CommandStringOptions extends BaseCommandOptions {
2356
+ maxLength?: number;
2357
+ }
2358
+
2359
+ interface CommandNumberOptions extends BaseCommandOptions {
2360
+ min?: number;
2361
+ max?: number;
2362
+ decimal?: boolean;
2363
+ }
2364
+
2365
+ interface BaseCommandOptions {
2366
+ title: string;
2367
+ }
2368
+
2369
+ interface CommandSelectOptions extends BaseCommandOptions {
2370
+ options: {
2371
+ label: string;
2372
+ value: string;
2373
+ }[];
2374
+ }
2375
+
2376
+ interface CommandContext {
2377
+ select(options: CommandSelectOptions): Promise<string>;
2378
+ number(options: CommandNumberOptions): Promise<number>;
2379
+ string(options: CommandStringOptions): Promise<string>;
2380
+ }
2381
+
2382
+ type CommandCallback = (context: CommandContext) => void | Promise<void>;
2383
+
2384
+ interface CommandOptions {
2385
+ text: string | (() => string);
2386
+ keywords?: string[];
2387
+ hidden?: () => boolean;
2388
+ }
2389
+
2390
+ class CommandsApi {
2391
+ /** Adds a command to the user's command palette. Can request additional input within the callback. */
2392
+ addCommand(id: string, options: CommandOptions, callback: CommandCallback): () => void;
2393
+ /** Removes all commands that were added with the same id */
2394
+ removeCommands(id: string): void;
2291
2395
  }
2292
2396
 
2293
2397
  class ScopedRewriterApi {
@@ -2311,6 +2415,23 @@ declare global {
2311
2415
  createShared(id: string, value: any): string;
2312
2416
  /** Removes the shared value with a certain id created by {@link createShared} */
2313
2417
  removeSharedById(id: string): void;
2418
+ /**
2419
+ * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded.
2420
+ * Returning true from the callback will remove the hook.
2421
+ */
2422
+ runInScope(prefix: string | boolean, callback: RunInScopeCallback): () => void;
2423
+ /** A utility function that exposes a variable based on regex to get its name. */
2424
+ exposeVar(prefix: string | boolean, exposer: Exposer): () => void;
2425
+ }
2426
+
2427
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2428
+ type RunInScopeCallback = (code: string, run: (evalCode: string) => void) => true | void;
2429
+
2430
+ interface Exposer {
2431
+ check?: string;
2432
+ find: RegExp;
2433
+ callback: (val: any) => void;
2434
+ multiple?: boolean;
2314
2435
  }
2315
2436
 
2316
2437
  class RewriterApi {
@@ -2321,10 +2442,10 @@ declare global {
2321
2442
  * @param pluginName The name of the plugin creating the hook.
2322
2443
  * @param prefix Limits the hook to only running on scripts beginning with this prefix.
2323
2444
  * Passing `true` will only run on the index script, and passing `false` will run on all scripts.
2324
- * @param callback The function that will modify the code. Should return the modified code. Cannot have side effects.
2445
+ * @param callback A function that will modify the code, which should return the modified code.
2325
2446
  */
2326
- addParseHook(pluginName: string, prefix: string | boolean, callback: (code: string) => string): () => void;
2327
- /** Removes all hooks created by a certain plugin */
2447
+ addParseHook(pluginName: string, prefix: string | boolean, modifier: (code: string) => string): () => void;
2448
+ /** Removes all parse hooks created by a certain plugin */
2328
2449
  removeParseHooks(pluginName: string): void;
2329
2450
  /**
2330
2451
  * Creates a shared value that can be accessed from any script.
@@ -2338,6 +2459,15 @@ declare global {
2338
2459
  removeShared(pluginName: string): void;
2339
2460
  /** Removes the shared value with a certain id created by {@link createShared} */
2340
2461
  removeSharedById(pluginName: string, id: string): void;
2462
+ /**
2463
+ * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded.
2464
+ * Returning true from the callback will remove the hook.
2465
+ */
2466
+ runInScope(pluginName: string, prefix: string | boolean, callback: RunInScopeCallback): () => void;
2467
+ /** Stops all hooks created by {@link runInScope} */
2468
+ removeRunInScope(pluginName: string): void;
2469
+ /** A utility function that exposes a variable based on regex to get its name. */
2470
+ exposeVar(pluginName: string, prefix: string | boolean, exposer: Exposer): () => void;
2341
2471
  }
2342
2472
 
2343
2473
  class ScopedPatcherApi {
@@ -2442,18 +2572,18 @@ declare global {
2442
2572
  }
2443
2573
 
2444
2574
  interface ModalOptions {
2445
- id: string;
2446
- title: string;
2447
- style: string;
2448
- className: string;
2449
- closeOnBackgroundClick: boolean;
2450
- buttons: ModalButton[];
2451
- onClosed: () => void;
2575
+ id?: string;
2576
+ title?: string;
2577
+ style?: string;
2578
+ className?: string;
2579
+ closeOnBackgroundClick?: boolean;
2580
+ buttons?: ModalButton[];
2581
+ onClosed?: () => void;
2452
2582
  }
2453
2583
 
2454
2584
  class BaseUIApi {
2455
2585
  /** Shows a customizable modal to the user */
2456
- showModal(element: HTMLElement | import("react").ReactElement, options?: Partial<ModalOptions>): void;
2586
+ showModal(element: HTMLElement | import("react").ReactElement, options?: ModalOptions): void;
2457
2587
  }
2458
2588
 
2459
2589
  class UIApi extends BaseUIApi {
@@ -2496,7 +2626,7 @@ declare global {
2496
2626
  /** Whether the user is the one hosting the current game */
2497
2627
  get isHost(): boolean;
2498
2628
  /** Sends a message to the server on a specific channel */
2499
- send(channel: string, message: any): void;
2629
+ send(channel: string, message?: any): void;
2500
2630
  }
2501
2631
 
2502
2632
  interface RequesterOptions {
@@ -2554,8 +2684,6 @@ declare global {
2554
2684
  }
2555
2685
 
2556
2686
  class ScopedParcelApi extends BaseParcelApi {
2557
- private readonly id;
2558
- constructor(id: string);
2559
2687
  /**
2560
2688
  * Waits for a module to be loaded, then runs a callback
2561
2689
  * @returns A function to cancel waiting for the module
@@ -2729,14 +2857,16 @@ declare global {
2729
2857
  static storage: Readonly<StorageApi>;
2730
2858
  /** Functions for intercepting the arguments and return values of functions */
2731
2859
  static patcher: Readonly<PatcherApi>;
2860
+ /** Functions for adding commands to the command palette */
2861
+ static commands: Readonly<CommandsApi>;
2732
2862
  /** Methods for getting info on libraries */
2733
2863
  static libs: Readonly<LibsApi>;
2734
2864
  /** Gets the exported values of a library */
2735
- static lib: (name: string) => any;
2865
+ static lib: <T extends keyof Gimloader.Libraries>(name: T) => Gimloader.Libraries[T];
2736
2866
  /** Methods for getting info on plugins */
2737
2867
  static plugins: Readonly<PluginsApi>;
2738
2868
  /** Gets the exported values of a plugin, if it has been enabled */
2739
- static plugin: (name: string) => any;
2869
+ static plugin: <T extends keyof Gimloader.Plugins>(name: T) => Gimloader.Plugins[T];
2740
2870
  /** Gimkit's internal react instance */
2741
2871
  static get React(): typeof import("react");
2742
2872
  /** Gimkit's internal reactDom instance */
@@ -2798,16 +2928,18 @@ declare global {
2798
2928
  storage: Readonly<ScopedStorageApi>;
2799
2929
  /** Functions for intercepting the arguments and return values of functions */
2800
2930
  patcher: Readonly<ScopedPatcherApi>;
2931
+ /** Functions for adding commands to the command palette */
2932
+ commands: Readonly<ScopedCommandsApi>;
2801
2933
  /** A utility for creating persistent settings menus, only available to plugins */
2802
2934
  settings: PluginSettings;
2803
2935
  /** Methods for getting info on libraries */
2804
2936
  libs: Readonly<LibsApi>;
2805
2937
  /** Gets the exported values of a library */
2806
- lib: (name: string) => any;
2938
+ lib: <T extends keyof Gimloader.Libraries>(name: T) => Gimloader.Libraries[T];
2807
2939
  /** Methods for getting info on plugins */
2808
2940
  plugins: Readonly<PluginsApi>;
2809
2941
  /** Gets the exported values of a plugin, if it has been enabled */
2810
- plugin: (name: string) => any;
2942
+ plugin: <T extends keyof Gimloader.Plugins>(name: T) => Gimloader.Plugins[T];
2811
2943
  /** Gimkit's internal react instance */
2812
2944
  get React(): typeof import("react");
2813
2945
  /** Gimkit's internal reactDom instance */
@@ -2829,6 +2961,14 @@ declare global {
2829
2961
  */
2830
2962
  openSettingsMenu: (callback: () => void) => void;
2831
2963
  }
2964
+
2965
+ interface Plugins {
2966
+ [name: string]: any;
2967
+ }
2968
+
2969
+ interface Libraries {
2970
+ [name: string]: any;
2971
+ }
2832
2972
  }
2833
2973
  const api: Gimloader.Api;
2834
2974
  const GL: typeof Gimloader.Api;
gimloader/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/gimloader",
3
- "version": "1.9.1",
3
+ "version": "1.10.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": "4afe930213069b4124381dc798d078235746605f68835e02486279102b33a6ab",
35
+ "typesPublisherContentHash": "cdd790249028d82ee8a23815e563ddf7acc6203d81d2f22ed3358a17b78232ee",
36
36
  "typeScriptVersion": "5.2"
37
37
  }