@@ -2273,6 +2273,7 @@ declare global {
22732273 immediate ?: boolean ,
22742274 ) : ( ) => void ;
22752275 onChange ( callback : ( ) => void ) : ( ) => void ;
2276+ onRemove ( callback : ( ) => void ) : ( ) => void ;
22762277 } ;
22772278 type CollectionSchema < T , K > = ColyseusMethods & {
22782279 onAdd ( callback : ( value : T , index : K ) => void , immediate ?: boolean ) : ( ) => void ;
@@ -2874,6 +2875,8 @@ declare global {
28742875 class BaseUIApi {
28752876 /** Shows a customizable modal to the user */
28762877 showModal ( element : HTMLElement | React$1 . ReactElement , options ?: ModalOptions ) : void ;
2878+ /** Forces Gimkit's react tree to fully rerender */
2879+ forceReactUpdate ( ) : void ;
28772880 /**
28782881 * Gimkit's notification object, only available when joining or playing a game
28792882 *
@@ -2960,6 +2963,8 @@ declare global {
29602963 ) => boolean | void ;
29612964
29622965 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 ;
29632968 class PatcherApi {
29642969 /**
29652970 * Runs a callback after a function on an object has been run
@@ -2992,6 +2997,16 @@ declare global {
29922997 method : K ,
29932998 callback : PatcherInsteadCallback < O [ K ] > ,
29942999 ) : ( ) => 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 ;
29953010 /** Removes all patches with a given id */
29963011 unpatchAll ( id : string ) : void ;
29973012 }
@@ -3025,10 +3040,19 @@ declare global {
30253040 method : K ,
30263041 callback : PatcherInsteadCallback < O [ K ] > ,
30273042 ) : ( ) => 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 ;
30283052 }
30293053
30303054 // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
3031- type RunInScopeCallback = ( code : string , run : ( evalCode : string ) => void ) => true | void ;
3055+ type RunInScopeCallback = ( code : string , run : ( evalCode : string ) => any , initial : boolean ) => true | void ;
30323056
30333057 interface Exposer {
30343058 check ?: string ;
0 commit comments