@types/gimloader 1.11.1 → 1.12.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 +1 -1
- gimloader/index.d.ts +47 -11
- gimloader/package.json +2 -2
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:
|
|
11
|
+
* Last updated: Sun, 22 Mar 2026 20:03:38 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
|
@@ -2261,19 +2261,25 @@ declare global {
|
|
|
2261
2261
|
error?: (error: any) => void;
|
|
2262
2262
|
}
|
|
2263
2263
|
namespace Schema {
|
|
2264
|
-
|
|
2264
|
+
interface ColyseusMethods {
|
|
2265
|
+
$callbacks: Record<string, any>;
|
|
2266
|
+
$changes: any;
|
|
2267
|
+
toJson(): any;
|
|
2268
|
+
}
|
|
2269
|
+
type ObjectSchema<T extends object> = T & ColyseusMethods & {
|
|
2265
2270
|
listen<K extends keyof T>(
|
|
2266
2271
|
key: K,
|
|
2267
2272
|
callback: (value: T[K], lastValue: T[K]) => void,
|
|
2268
2273
|
immediate?: boolean,
|
|
2269
2274
|
): () => void;
|
|
2270
2275
|
onChange(callback: () => void): () => void;
|
|
2276
|
+
onRemove(callback: () => void): () => void;
|
|
2271
2277
|
};
|
|
2272
|
-
|
|
2278
|
+
type CollectionSchema<T, K> = ColyseusMethods & {
|
|
2273
2279
|
onAdd(callback: (value: T, index: K) => void, immediate?: boolean): () => void;
|
|
2274
2280
|
onRemove(callback: (value: T, index: K) => void): () => void;
|
|
2275
2281
|
onChange(callback: (item: T, index: K) => void): () => void;
|
|
2276
|
-
}
|
|
2282
|
+
};
|
|
2277
2283
|
type MapSchema<T> =
|
|
2278
2284
|
& {
|
|
2279
2285
|
[key: string]: T;
|
|
@@ -2299,6 +2305,7 @@ declare global {
|
|
|
2299
2305
|
interface HealthState {
|
|
2300
2306
|
classImmunityActive: boolean;
|
|
2301
2307
|
fragility: number;
|
|
2308
|
+
health: number;
|
|
2302
2309
|
lives: number;
|
|
2303
2310
|
maxHealth: number;
|
|
2304
2311
|
maxShield: number;
|
|
@@ -2316,11 +2323,16 @@ declare global {
|
|
|
2316
2323
|
waitingEndTime: number;
|
|
2317
2324
|
waitingStartTime: number;
|
|
2318
2325
|
}
|
|
2326
|
+
interface SlotState {
|
|
2327
|
+
amount: number;
|
|
2328
|
+
}
|
|
2319
2329
|
interface InventoryState {
|
|
2320
2330
|
activeInteractiveSlot: number;
|
|
2321
2331
|
infiniteAmmo: boolean;
|
|
2322
|
-
interactiveSlots: MapSchema<InteractiveSlotState
|
|
2332
|
+
interactiveSlots: MapSchema<ObjectSchema<InteractiveSlotState>>;
|
|
2323
2333
|
interactiveSlotsOrder: ArraySchema<number>;
|
|
2334
|
+
maxSlots: number;
|
|
2335
|
+
slots: MapSchema<ObjectSchema<SlotState>>;
|
|
2324
2336
|
}
|
|
2325
2337
|
interface PermissionsState {
|
|
2326
2338
|
adding: boolean;
|
|
@@ -2386,8 +2398,8 @@ declare global {
|
|
|
2386
2398
|
url: string;
|
|
2387
2399
|
}
|
|
2388
2400
|
interface CallToActionState {
|
|
2389
|
-
categories: ArraySchema<ActionCategoryState
|
|
2390
|
-
items: ArraySchema<ActionItemState
|
|
2401
|
+
categories: ArraySchema<ObjectSchema<ActionCategoryState>>;
|
|
2402
|
+
items: ArraySchema<ObjectSchema<ActionItemState>>;
|
|
2391
2403
|
}
|
|
2392
2404
|
interface GameSessionState {
|
|
2393
2405
|
callToAction: ObjectSchema<CallToActionState>;
|
|
@@ -2437,15 +2449,16 @@ declare global {
|
|
|
2437
2449
|
score: number;
|
|
2438
2450
|
}
|
|
2439
2451
|
interface GimkitState {
|
|
2440
|
-
characters: MapSchema<CharacterState
|
|
2441
|
-
customAssets: MapSchema<CustomAssetState
|
|
2452
|
+
characters: MapSchema<ObjectSchema<CharacterState>>;
|
|
2453
|
+
customAssets: MapSchema<ObjectSchema<CustomAssetState>>;
|
|
2442
2454
|
hooks: ObjectSchema<HooksState>;
|
|
2443
2455
|
mapSettings: string;
|
|
2444
2456
|
matchmaker: ObjectSchema<MatchmakerState>;
|
|
2445
2457
|
session: ObjectSchema<SessionState>;
|
|
2446
|
-
teams: ArraySchema<TeamState
|
|
2458
|
+
teams: ArraySchema<ObjectSchema<TeamState>>;
|
|
2447
2459
|
world: ObjectSchema<WorldState>;
|
|
2448
2460
|
}
|
|
2461
|
+
type GimkitSchema = ObjectSchema<GimkitState>;
|
|
2449
2462
|
}
|
|
2450
2463
|
class BaseNetApi extends EventEmitter2 {
|
|
2451
2464
|
constructor();
|
|
@@ -2456,7 +2469,7 @@ declare global {
|
|
|
2456
2469
|
/** The room that the client is connected to, or null if there is no connection */
|
|
2457
2470
|
get room(): any;
|
|
2458
2471
|
/** Gimkit's internal Colyseus state */
|
|
2459
|
-
get state(): Schema.
|
|
2472
|
+
get state(): Schema.GimkitSchema;
|
|
2460
2473
|
/** Whether the user is the one hosting the current game */
|
|
2461
2474
|
get isHost(): boolean;
|
|
2462
2475
|
/** Sends a message to the server on a specific channel */
|
|
@@ -2862,6 +2875,8 @@ declare global {
|
|
|
2862
2875
|
class BaseUIApi {
|
|
2863
2876
|
/** Shows a customizable modal to the user */
|
|
2864
2877
|
showModal(element: HTMLElement | React$1.ReactElement, options?: ModalOptions): void;
|
|
2878
|
+
/** Forces Gimkit's react tree to fully rerender */
|
|
2879
|
+
forceReactUpdate(): void;
|
|
2865
2880
|
/**
|
|
2866
2881
|
* Gimkit's notification object, only available when joining or playing a game
|
|
2867
2882
|
*
|
|
@@ -2948,6 +2963,8 @@ declare global {
|
|
|
2948
2963
|
) => boolean | void;
|
|
2949
2964
|
|
|
2950
2965
|
type PatcherInsteadCallback<T> = (thisVal: any, args: T extends BaseFunction ? Parameters<T> : any[]) => any;
|
|
2966
|
+
|
|
2967
|
+
type PatcherSwapCallback<T> = (...args: T extends BaseFunction ? Parameters<T> : any[]) => any;
|
|
2951
2968
|
class PatcherApi {
|
|
2952
2969
|
/**
|
|
2953
2970
|
* Runs a callback after a function on an object has been run
|
|
@@ -2980,6 +2997,16 @@ declare global {
|
|
|
2980
2997
|
method: K,
|
|
2981
2998
|
callback: PatcherInsteadCallback<O[K]>,
|
|
2982
2999
|
): () => void;
|
|
3000
|
+
/**
|
|
3001
|
+
* Replaces a function on an object with another function
|
|
3002
|
+
* @returns A function to remove the patch
|
|
3003
|
+
*/
|
|
3004
|
+
swap<O extends object, K extends FunctionKeys<O>>(
|
|
3005
|
+
id: string,
|
|
3006
|
+
object: O,
|
|
3007
|
+
method: K,
|
|
3008
|
+
callback: PatcherSwapCallback<O[K]>,
|
|
3009
|
+
): () => void;
|
|
2983
3010
|
/** Removes all patches with a given id */
|
|
2984
3011
|
unpatchAll(id: string): void;
|
|
2985
3012
|
}
|
|
@@ -3013,10 +3040,19 @@ declare global {
|
|
|
3013
3040
|
method: K,
|
|
3014
3041
|
callback: PatcherInsteadCallback<O[K]>,
|
|
3015
3042
|
): () => void;
|
|
3043
|
+
/**
|
|
3044
|
+
* Replaces a function on an object with another function
|
|
3045
|
+
* @returns A function to remove the patch
|
|
3046
|
+
*/
|
|
3047
|
+
swap<O extends object, K extends FunctionKeys<O>>(
|
|
3048
|
+
object: O,
|
|
3049
|
+
method: K,
|
|
3050
|
+
callback: PatcherSwapCallback<O[K]>,
|
|
3051
|
+
): () => void;
|
|
3016
3052
|
}
|
|
3017
3053
|
|
|
3018
3054
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
3019
|
-
type RunInScopeCallback = (code: string, run: (evalCode: string) =>
|
|
3055
|
+
type RunInScopeCallback = (code: string, run: (evalCode: string) => any, initial: boolean) => true | void;
|
|
3020
3056
|
|
|
3021
3057
|
interface Exposer {
|
|
3022
3058
|
check?: string;
|
gimloader/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/gimloader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
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": "
|
|
35
|
+
"typesPublisherContentHash": "4dee83f45a8e1a086d24e48496e7bbc62e9c50dae8c27ca08e57fb82748939d5",
|
|
36
36
|
"typeScriptVersion": "5.2"
|
|
37
37
|
}
|