From a53981ec20303559beb77eda960d36531b7de287 Mon Sep 17 00:00:00 2001 From: Michael Manzinger Date: Sun, 8 Feb 2026 16:23:13 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74433=20[pdfma?= =?UTF-8?q?ke]=20Add=20properties=20for=200.3.3=20by=20@kryops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/pdfmake/interfaces.d.ts | 60 ++++++++++++++++--- types/pdfmake/test/pdfmake-examples-tests.ts | 55 +++++++++++++++++ .../pdfmake/test/pdfmake-interfaces-tests.ts | 26 ++++++++ 3 files changed, 134 insertions(+), 7 deletions(-) diff --git a/types/pdfmake/interfaces.d.ts b/types/pdfmake/interfaces.d.ts index 5d26f6660c555a..ba65d2e761c2c1 100755 --- a/types/pdfmake/interfaces.d.ts +++ b/types/pdfmake/interfaces.d.ts @@ -726,11 +726,21 @@ export interface Style { */ decorationColor?: string | undefined; + /** + * Line thickness of the {@link decoration} in `pt`. + * + * If used in combination with a {@link decorationStyle}, this value is only used as a baseline + * for the computation of the actual line width. + * + * Defaults to a value derived from the {@link fontSize}. + */ + decorationThickness?: number | undefined; + /** * Margins to apply. * * Overrides the single-side `marginXXX` properties, unless this value is inherited - * from a style and they are set directly on the content object. + * from another style. * * Ignored for content within an inline text array * (`{ text: [{ ... }] }`). @@ -741,7 +751,7 @@ export interface Style { * Margin in `pt` to apply above the content. * * If {@link margin} is set, this value is ignored, unless the margin was inherited - * from a style and the value is set directly on the content object. + * from another style. */ marginTop?: number | undefined; @@ -749,7 +759,7 @@ export interface Style { * Margin in `pt` to apply to the right of the content. * * If {@link margin} is set, this value is ignored, unless the margin was inherited - * from a style and the value is set directly on the content object. + * from another style. */ marginRight?: number | undefined; @@ -757,7 +767,7 @@ export interface Style { * Margin in `pt` to apply below the content. * * If {@link margin} is set, this value is ignored, unless the margin was inherited - * from a style and the value is set directly on the content object. + * from another style. */ marginBottom?: number | undefined; @@ -765,7 +775,7 @@ export interface Style { * Margin in `pt` to apply to the left of the content. * * If {@link margin} is set, this value is ignored, unless the margin was inherited - * from a style and the value is set directly on the content object. + * from another style. */ marginLeft?: number | undefined; @@ -872,6 +882,21 @@ export interface Style { columnGap?: number | undefined; } +/** + * Named style defined in {@link TDocumentDefinitions.styles}. + */ +export interface NamedStyle extends Style { + /** + * Names of other styles in {@link TDocumentDefinitions.styles} to extend. + * + * An array applies the styles in the given order, later styles overriding + * properties from the earlier ones. + * + * Extended styles are overridden by the properties on this style. + */ + extends?: string | string[] | undefined; +} + /** * Applies one or more styles. * @@ -1623,6 +1648,27 @@ export interface TableOfContent { * {@link ContentTocItem.tocItem} to its ID */ id?: string | undefined; + + /** + * If set to `true`, the table of contents is hidden when it contains no items. + */ + hideEmpty?: boolean | undefined; + + /** + * Controls how the items are sorted. + * + * Defaults to `page`. + */ + sortBy?: "page" | "title" | undefined; + + /** + * Specifies the locale used for sorting as BCP 47 language tag, e.g. `en-US`. + * + * Only relevant if {@link sortBy} is set to `title`. + * + * Defaults to the system locale. + */ + sortLocale?: string | undefined; } /** @@ -1990,7 +2036,7 @@ export interface ImageCover { * Dictionary of reusable style definitions that can be referenced by their key. */ export interface StyleDictionary { - [name: string]: Style; + [name: string]: NamedStyle; } /** @@ -2264,7 +2310,7 @@ export interface TDocumentDefinitions { /** * Dictionary for reusable styles to be referenced by their key throughout the document. * - * To define styles that should apply by default, use {@link defaultStyles} instead. + * To define styles that should apply by default, use {@link defaultStyle} instead. */ styles?: StyleDictionary | undefined; diff --git a/types/pdfmake/test/pdfmake-examples-tests.ts b/types/pdfmake/test/pdfmake-examples-tests.ts index 344b5d299bf0ff..7f2407e878e522 100644 --- a/types/pdfmake/test/pdfmake-examples-tests.ts +++ b/types/pdfmake/test/pdfmake-examples-tests.ts @@ -912,6 +912,50 @@ const margins: TDocumentDefinitions = { }, }; +const namedStylesWithExtends: TDocumentDefinitions = { + content: [ + { + text: "This is a header, using header style", + style: "header", + }, + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam.\n\n", + { + text: "Subheader 1 - using subheader style", + style: "subheader", + }, + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.", + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.", + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.\n\n", + { + text: "Subheader 2 - using subheader style", + style: "subheader", + }, + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.", + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Confectum ponit legam, perferendis nomine miserum, animi. Moveat nesciunt triari naturam posset, eveniunt specie deorsus efficiat sermone instituendarum fuisse veniat, eademque mutat debeo. Delectet plerique protervi diogenem dixerit logikh levius probabo adipiscuntur afficitur, factis magistra inprobitatem aliquo andriam obiecta, religionis, imitarentur studiis quam, clamat intereant vulgo admonitionem operis iudex stabilitas vacillare scriptum nixam, reperiri inveniri maestitiam istius eaque dissentias idcirco gravis, refert suscipiet recte sapiens oportet ipsam terentianus, perpauca sedatio aliena video.\n\n", + { + text: + "It is possible to apply multiple styles, by passing an array. This paragraph uses two styles: quote and small. When multiple styles are provided, they are evaluated in the specified order which is important in case they define the same properties", + style: ["quote", "small"], + }, + ], + styles: { + header: { + fontSize: 18, + bold: true, + }, + subheader: { + fontSize: 15, + extends: "header", + }, + quote: { + italics: true, + }, + small: { + fontSize: 8, + }, + }, +}; + const pageReference: TDocumentDefinitions = { content: [ { @@ -2467,6 +2511,15 @@ const textDecorations: TDocumentDefinitions = { }, ], }, + " ", + { + columns: [ + { text: "Dashed style", decoration: "underline", decorationStyle: "dashed", decorationThickness: 3 }, + { text: "Dotted style", decoration: "underline", decorationStyle: "dotted", decorationThickness: 3 }, + { text: "Double style", decoration: "underline", decorationStyle: "double", decorationThickness: 3 }, + { text: "Wavy style", decoration: "underline", decorationStyle: "wavy", decorationThickness: 3 }, + ], + }, ], }; @@ -2483,6 +2536,8 @@ const toc: TDocumentDefinitions = { textMargin: [0, 0, 0, 0], textStyle: { italics: true }, numberStyle: { bold: true }, + sortBy: "page", + sortLocale: "cs", }, }, { diff --git a/types/pdfmake/test/pdfmake-interfaces-tests.ts b/types/pdfmake/test/pdfmake-interfaces-tests.ts index f8d6da0e524092..94cd068b23ab35 100644 --- a/types/pdfmake/test/pdfmake-interfaces-tests.ts +++ b/types/pdfmake/test/pdfmake-interfaces-tests.ts @@ -5,8 +5,10 @@ import { ContentImage, ContentOrderedList, ContentSvg, + ContentToc, ContentUnorderedList, CustomTableLayout, + StyleDictionary, Table, TableCell, TDocumentDefinitions, @@ -403,3 +405,27 @@ const svgWithLink: Content = [ link: "http://foo.bar", }, ]; + +const hideEmptyToC: ContentToc = { + toc: { + hideEmpty: true, + }, +}; + +const styleExtends: StyleDictionary = { + header: { + fontSize: 18, + bold: true, + }, + subheader: { + fontSize: 15, + extends: "header", + }, + smallheader: { + italics: true, + extends: ["subheader", "small"], + }, + small: { + fontSize: 8, + }, +}; From 6873bb7039d673a432c3a705be7c2dfd6211ceed Mon Sep 17 00:00:00 2001 From: TheLazySquid <76746384+TheLazySquid@users.noreply.github.com> Date: Sun, 8 Feb 2026 12:23:05 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74494=20[Gimlo?= =?UTF-8?q?ader]=20Update=20types=20to=201.11=20by=20@TheLazySquid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/gimloader/gimloader-tests.ts | 31 +- types/gimloader/index.d.ts | 4829 ++++++++++++++-------------- types/gimloader/package.json | 2 +- 3 files changed, 2498 insertions(+), 2364 deletions(-) diff --git a/types/gimloader/gimloader-tests.ts b/types/gimloader/gimloader-tests.ts index 75a90278aaf592..cef2a559ed2aee 100644 --- a/types/gimloader/gimloader-tests.ts +++ b/types/gimloader/gimloader-tests.ts @@ -63,6 +63,7 @@ api.UI.showModal(document.createElement("div"), { ], }); +api.requestReload(); api.patcher.before({}, "foo", () => {}); api.patcher.before({}, "foo", () => true); GL.net.gamemode; // $ExpectType string @@ -111,8 +112,8 @@ api.commands.addCommand({ api.commands.addCommand({ text: () => "something" }, () => {}); -GL.stores.phaser; // $ExpectType Phaser -window.stores.phaser; // $ExpectType Phaser +GL.stores.phaser; // $ExpectType PhaserStore +window.stores.phaser; // $ExpectType PhaserStore let worldManagerInstance!: Gimloader.Stores.WorldManager; worldManagerInstance; // $ExpectType WorldManager @@ -123,6 +124,7 @@ api.stores.worldOptions.terrainOptions[0].name; // $ExpectType string api.stores.phaser.scene.add; // $ExpectType GameObjectFactory api.stores.phaser.mainCharacter.input; // $ExpectType CharacterInput api.stores.phaser.mainCharacter.physics.getBody().rigidBody.translation(); // $ExpectType Vector +api.stores.phaser.mainCharacter.physics.getBody().character.feetSensor; // $ExpectType Collider const { actionManager, characterManager, inputManager, tileManager, worldManager } = api.stores.phaser.scene; actionManager; // $ExpectType ActionManager @@ -149,7 +151,7 @@ api.settings.something = 123; api.settings.something = "abc"; api.settings.something = {}; api.settings.listen("someSetting", (val: any) => {}); -api.settings.create([ +const settings = api.settings.create([ { type: "group", title: "Group", @@ -191,7 +193,7 @@ api.settings.create([ ], title: "A Multiselect", default: ["optionA", "optionC"], - onChange: (value: string[]) => {}, + onChange: (value: readonly string[]) => {}, }, { type: "number", @@ -263,3 +265,24 @@ api.settings.create([ onChange: (value: any) => {}, }, ]); + +// @ts-expect-error +settings.listen("fakekey", () => {}); +// @ts-expect-error +settings.listen("number1", (value: string) => {}); +settings.listen("number1", (value) => { + value; // $ExpectType number +}); +// @ts-expect-error +settings.fakekey; +settings.toggle1; // $ExpectType boolean +settings.toggle2; // $ExpectType boolean +settings.color1; // $ExpectType string +settings.dropdown1; // $ExpectType string +settings.multiselect1; // $ExpectType readonly string[] +settings.number1; // $ExpectType number +settings.radio1; // $ExpectType string +settings.slider1; // $ExpectType number +settings.text1; // $ExpectType string +settings.custom1; // $ExpectType any +settings.customsection1; // $ExpectType any diff --git a/types/gimloader/index.d.ts b/types/gimloader/index.d.ts index 009d2cf8955859..1c800cc6efadab 100644 --- a/types/gimloader/index.d.ts +++ b/types/gimloader/index.d.ts @@ -1,1086 +1,726 @@ export {}; -import { Collider, ColliderDesc, RigidBody, RigidBodyDesc, Vector } from "@dimforge/rapier2d-compat"; -import { EventEmitter2 } from "eventemitter2"; -import { Scene as BaseScene } from "phaser"; +import { + Collider, + ColliderDesc, + KinematicCharacterController, + RigidBody, + RigidBodyDesc, + Vector, + World, +} from "@dimforge/rapier2d-compat"; +import EventEmitter2 from "eventemitter2"; +import { GameObjects, Input, Scene as BaseScene, Tweens, Types } from "phaser"; +import * as React$1 from "react"; declare global { namespace Gimloader { namespace Stores { - interface Team { - characters: Map; + interface Shapes { + circles: number[][]; + lines: number[][]; + paths: number[][]; + rects: number[][]; + } + interface CustomAsset { + data: { + shapes: Shapes; + }; + icon: string; id: string; name: string; - score: number; + optionId: string; } - - interface Teams { - teams: Map; + interface WorldCustomAssets { + customAssets: Map; + isUIOpen: boolean; updateCounter: number; } - - interface SceneStore { - currentScene: string; - gpuTier: number; - isCursorOverCanvas: boolean; + interface CodeGridSchema { + allowChannelGrids: boolean; + customBlocks: any[]; + triggers: any[]; } - - interface CharacterOptions { + interface WireConnection { id: string; - x: number; - y: number; - scale: number; - type: string; - } - - interface Spectating { - findNewCharacter(): void; - onBeginSpectating(): void; - onEndSpectating(): void; - setShuffle(shuffle: boolean, save?: boolean): void; - } - - interface CharacterManager { - characterContainer: import("phaser").GameObjects.Container; - characters: Map; - scene: Scene; - spectating: Spectating; - addCharacter(options: CharacterOptions): Character; - cullCharacters(): void; - removeCharacter(id: string): void; - update(dt: number): void; + name: string; } - - interface Removal { - overlay: Overlay; - prevMouseWasDown: boolean; - scene: Scene; - checkForItem(): void; - createStateListeners(): void; - removeSelectedItems(): void; - update(): void; + interface DeviceOption { + codeGridSchema: CodeGridSchema; + defaultState: Record; + description?: string; + id: string; + initialMemoryCost?: number; + maxOnMap?: number; + maximumRoleLevel?: number; + minimumRoleLevel?: number; + name?: string; + optionSchema: { + options: any[]; + }; + seasonTicketRequired?: boolean; + subsequentMemoryCost?: number; + supportedMapStyles?: string[]; + wireConfig: { + in: { + connections: WireConnection[]; + }; + out: { + connections: WireConnection[]; + }; + }; } - - interface PlatformerEditing { - setTopDownControlsActive(active: boolean): void; + interface DeviceData { + depth: number; + deviceOption: DeviceOption; + existsBeforeReconnect: boolean; + hooks: any; + id: string; + isPreview: boolean; + layerId: string; + name: any; + options: Record; + props: any; + x: number; + y: number; } - - interface SelectedDevicesOverlay { - graphics: import("phaser").GameObjects.Graphics; - scene: Scene; - showing: boolean; - hide(): void; - show(rects: Rect[]): void; + interface CodeGridItem { + createdAt: number; + existsBeforeReconnect: boolean; + json: string; + triggerType: string; + owner?: string; + triggerValue?: string; + visitors: string[]; } - - interface MultiSelect { - boundingBoxAroundEverything: Rect | null; - currentlySelectedDevices: Device[]; - currentlySelectedDevicesIds: string[]; - hidingSelectionForDevices: boolean; - isSelecting: boolean; - modifierKeyDown: boolean; - mouseShifts: Vector[]; - movedOrCopiedDevices: Device[]; - overlay: Overlay; - scene: Scene; - selectedDevices: Device[]; - selectedDevicesIds: string[]; - selectedDevicesOverlay: SelectedDevicesOverlay; - selection: Rect | null; - addDeviceToSelection(device: Device): void; - endSelectionRect(): void; - findSelectedDevices(): void; - hasSomeSelection(): boolean; - hideSelection(): void; - multiselectDeleteKeyHandler(): void; - multiselectKeyHandler(down: boolean): void; - onDeviceAdded(device: Device): void; - onDeviceRemoved(id: string): void; - setShiftParams(): void; - startSelectionRect(): void; - unselectAll(): void; - update(): void; - updateSelectedDevicesOverlay(): void; - updateSelectionRect(): void; + interface CodeGrid { + existsBeforeReconnect: boolean; + items: Map; } - - interface DepthSort { - overlay: Overlay; - scene: Scene; - update(): void; + interface DeviceState { + deviceId: string; + properties: Map; } - - interface ActionManager { - depthSort: DepthSort; - multiSelect: MultiSelect; - platformerEditing: PlatformerEditing; - removal: Removal; - update(): void; + interface WorldDevices { + codeGrids: Map; + devices: Map; + states: Map; } - - interface TileKey { + interface Tile { + collides: boolean; depth: number; + terrain: string; x: number; y: number; } - - interface BackgroundLayersManager { - layerManager: LayerManager; - scene: Scene; - createLayer(options: { - layerId: string; - depth: number; - }): void; - fill(terrain: TerrainOption): void; - fillForPlatformer(): void; - fillForTopDown(terrain: TerrainOption): void; - removeLayer(options: { - layerId: string; - }): void; + interface QueuedTile { + timestamp: number; + removedBodyIds: string[]; } - - interface LayerManager { - backgroundLayersManager: BackgroundLayersManager; - colliders: Map>; - layers: Map; - scene: Scene; - createInitialLayers(): void; - createLayer(id: string): void; - fillBottomLayer(terrain: TerrainOption): void; - getActualLayerDepth(id: string): number; - moveLayersAboveCharacters(): void; - onWorldSizeChange(): void; + interface Terrain { + currentTerrainUpdateId: number; + modifiedHealth: Map; + queuedTiles: Map; + teamColorTiles: Map; + tiles: Map; } - - interface TileManager { - cumulTime: number; - scene: Scene; - layerManager: LayerManager; - damageTileAtXY(x: number, y: number, depth: number, damage: number, healthPercent: number): void; - destroyTileByTileKey(tileKey: TileKey): void; - onMapStyleSet(): void; - regenerateTileAtXY(x: number, y: number, depth: number, healthPercent: number): void; - update(dt: number): void; - updateTeamColorTileAtXY(x: number, y: number, depth: number, team?: string, playerId?: string): void; + interface GimkitWorld { + customAssets: WorldCustomAssets; + devices: WorldDevices; + height: number; + width: number; + mapOptionsJSON: string; + terrain: Terrain; + wires: { + wires: Map; + }; } - - interface Projectile { + interface ExistingDevice { + action: string; id: string; - startTime: number; - endTime: number; - start: Vector; - end: Vector; - radius: number; - appearance: string; - ownerId: string; - ownerTeamId: string; - damage: number; - hitPos?: Vector; - hitTime?: number; + shiftX: number; + shiftY: number; + use: boolean; } - - interface Projectiles { - damageMarkers: any; - dynamicDevices: Set; - fireSlashes: any; - projectileJSON: Map; - runClientSidePrediction: boolean; - scene: Scene; - addProjectile(projectile: Projectile): void; - fire(pointer: import("phaser").Input.Pointer, snap: boolean): void; - update(): void; - } - - interface WorldBoundsCollider { - body: RigidBody; - collider: Collider; + interface AddingDevices { + currentlySelectedProp: string; + existingDevice: ExistingDevice; + selectedDeviceType: string; } - - interface BodyBounds { - minX: number; - minY: number; - maxX: number; - maxY: number; + interface AddingTerrain { + brushSize: number; + buildTerrainAsWall: boolean; + currentlySelectedTerrain: string; + currentlySelectedTerrainDepth: number; } - - interface BodyStatic { - bounds: BodyBounds; - cells: Set; + interface AddingWires { + hoveringOverSupportedDevice: boolean; + pointUnderMouseDeviceId?: string; + startDeviceSelected: boolean; } - - interface Body { - collider?: Collider; - colliderDesc: ColliderDesc; - rigidBody?: RigidBody; - rigidBodyDesc: RigidBodyDesc; - static: BodyStatic; - device?: { - id: string; - }; - terrain?: { - key: string; - }; + interface Adding { + devices: AddingDevices; + terrain: AddingTerrain; + wires: AddingWires; + mode: string; } - - interface ActiveBodies { - activeBodies: Set; - bodyManager: BodyManager; - currentCoordinateKeys: Set; - world: World; - disableBody(id: string): void; - enable(keys: Set, setAll: boolean): void; - enableBodiesAlongLine(options: { - start: Vector; - end: Vector; - }): void; - enableBodiesWithinAreas(options: { - areas: Rect[]; - disableActiveBodiesOutsideArea: boolean; - }): void; - enableBody(id: string): void; - setDirty(): void; + interface CinematicMode { + charactersVisible: boolean; + enabled: boolean; + followingMainCharacter: boolean; + hidingGUI: boolean; + mainCharacterVisible: boolean; + nameTagsVisible: boolean; } - - interface BodyManager { - activeBodies: ActiveBodies; - bodies: Map; - cells: Map>; - dynamicBodies: Set; - gridSize: number; - staticBodies: Set; - staticSensorBodies: Set; - _idCount: number; - find(id: string): Body | undefined; - findPotentialStaticBodiesWithinArea(area: Rect): Set; - generateId(): void; - insert(body: Body): string; - remove(id: string): void; + interface ClassDesigner { + activeClassDeviceId: string; + lastActivatedClassDeviceId: string; + lastClassDeviceActivationId: number; } - - interface PhysicsManager { - bodies: BodyManager; - cumulTime: number; - lastTime: number; - physicsStep(dt: number): void; - runPhysicsLoop(dt: number): void; - world: World; - worldBoundsColliders: Set; + interface Context { + cursorIsOverCharacterId: string; + __devicesUnderCursor: string[]; + __wiresUnderCursor: Set; + cursorIsOverDevice: boolean; + cursorIsOverWire: boolean; } - - interface CreateTileOptions { - x: number; - y: number; - tileIndex: number; - terrainOption: TerrainOption; + interface MeCustomAssets { + currentData?: { + shapes: Shapes; + }; + currentIcon: string; + currentId: string; + currentName: string; + currentOptionId: string; + isUIOpen: boolean; + openOptionId: string | null; + pendingDeleteId: string | null; + showDeleteConfirm: boolean; } - - interface InGameTerrainBuilder { - afterFailureWithTouch: boolean; - overlay: Overlay; - previewingTile?: Vector; - scene: Scene; - wasDown: boolean; - clearConsumeErrorMessage(): void; - clearPreviewLayer(): void; - createPreviewTile(options: CreateTileOptions): void; - update(): void; + interface MeDeviceUI { + current: { + deviceId: string; + props: Record; + }; + desiredOpenDeviceId?: string; + serverVersionOpenDeviceId: string; } - - interface WorldInteractives { - scene: Scene; - currentDevice?: Device; - clearCurrentDevice(): void; - setCurrentDevice(device: Device): void; - update(devices: Device[]): void; - canBeReachedByPlayer(device: Device): boolean; - findClosestInteractiveDevice(devices: Device[], x: number, y: number): Device | undefined; + interface CurrentlyEditedDevice { + deviceOptionId: string; + id: string; } - - interface ShowOverlayOptions { - x: number; - y: number; - width: number; - height: number; + interface SortingState { depth: number; + deviceId: string; + deviceName: string; + globalDepth: number; + layer: string; + y: number; } - - interface Overlay { - scene: Scene; - showing: boolean; - showingDimensions: { - width: number; - height: number; - } | null; - showingPosition: { - x: number; - y: number; - } | null; - hide(): void; - show(options: ShowOverlayOptions): void; + interface VisualEditing { + active: boolean; + cursor: string; + id: string; + instruction: string; + keyboardHelpers: { + trigger: string; + action: string; + }[]; } - - interface DevicesPreview { - devicePreviewOverlay: Overlay; - previousDevices: Device[]; - scene: Scene; - removePreviousDevices(isBeingReplaced: boolean): void; - update(): void; + interface EditingDevice { + currentlyEditedDevice: CurrentlyEditedDevice; + currentlyEditedGridId: string; + currentlySortedDeviceId: string; + screen: string; + sortingState: SortingState[]; + usingMultiselect: boolean; + visualEditing: VisualEditing; } - - interface DevicesAction { - inputManager: InputManager; - scene: Scene; - onClick(arg: any): void; - update(): void; + interface EditingPreferences { + cameraZoom: number; + movementSpeed: number | null; + phase: boolean | null; + showGrid: boolean | null; + topDownControlsActive: boolean; } - - interface DeviceProjectiles { - device: Device; - addToDynamicDevices(): void; - collidesWithProjectile(object: Circle): boolean; - onClientPredictedHit(position: Vector): void; - removeFromDynamicDevices(): void; - setDynamic(dynamic: boolean): void; + interface Editing { + device: EditingDevice; + preferences: EditingPreferences; + wire: { + currentlyEditedWireId: string; + }; } - - interface DeviceTweens { - list: import("phaser").Tweens.Tween[]; - device: Device; - add(config: import("phaser").Types.Tweens.TweenBuilderConfig): import("phaser").Tweens.Tween; - destroy(): void; + interface Health { + fragility: number; + health: number; + lives: number; + maxHealth: number; + maxShield: number; + shield: number; } - - interface WirePoints { - device: Device; - end: Vector; - start: Vector; - onPointChange(): void; - setBoth(x: number, y: number): void; + interface InteractiveInfo { + action: string; + allowedToInteract: boolean; + message: string; + topHeader?: string; + topHeaderColor: string; } - - interface Layers { - depth: number; - device: Device; - layer: string; - options: any; - } - - interface ShadowOptions { - x: number; - y: number; - r1: number; - r2: number; - alphaMultip: number; - depth: number; + interface Interactives { + deviceId: string; + info: InteractiveInfo; } - - interface Shadows { - device: Device; - list: ShadowOptions[]; - add(options: ShadowOptions): void; - destroy(): void; - forEach(callback: (shadow: ShadowOptions) => void): void; - hide(): void; - show(): void; + interface InteractiveSlot { + clipSize: number; + count: number; + currentClip: number; + durability: number; + itemId: string; + waiting: boolean; + waitingEndTime: number; + waitingStartTime: number; } - - interface Circle { - x: number; - y: number; - radius: number; + interface AlertFeed { + amount: number; + itemId: string; } - - interface RotatedCircle extends Circle { - angle: number; + interface InventorySlot { + amount: number; + existsBeforeReconnect: boolean; } - - interface VisualEditingCircle { - angle: number; - rotable: boolean; - radius: number; - minRadius: number; - maxRadius: number; - onChange(value: RotatedCircle): void; + interface Inventory { + activeInteractiveSlot: number; + alertFeed?: AlertFeed; + alertsFeed: AlertFeed[]; + currentWaitingEndTime: number; + infiniteAmmo: boolean; + interactiveSlotErrorMessageTimeouts: Map>; + interactiveSlotErrorMessages: Map; + interactiveSlots: Map; + interactiveSlotsOrder: number[]; + isCurrentWaitingSoundForItem: boolean; + lastShotsTimestamps: Map; + maxSlots: number; + slots: Map; } - - interface RotatedRect extends Rect { - angle: number; + interface MobileControls { + left: boolean; + right: boolean; + up: boolean; } - - interface VisualEditingBox { - width: number; - height: number; - angle: number; - minWidth: number; - maxWidth: number; - minHeight: number; - maxHeight: number; - keepRatio: boolean; - rotable: boolean; - onChange(value: RotatedRect): void; + interface Mood { + activeDeviceId: string; + vignetteActive: boolean; + vignetteStrength: number; } - - interface DeviceVisualEditing { - add: { - box(options: VisualEditingBox): void; - circle(options: VisualEditingCircle): void; - }; - device: Device; - isActive: boolean; - shapes: (VisualEditingBox | VisualEditingCircle)[]; - clear(): void; + interface NonDismissMessage { + description: string; + title: string; } - - interface InteractiveZones { - add: { - circle(zone: CircleShort): void; - rect(zone: Rect): void; - }; - canInteractThroughColliders: boolean; - device: Device; - forceDisabled: boolean; - zones: (CircleShort | Rect)[]; - contains(x: number, y: number): boolean; - destroy(): void; - getCanInteractThroughColliders(): boolean; - getInfo(): any; - getMaxDistance(x: number, y: number): number; - isInteractive(): boolean; - onPlayerCanInteract(): void; - onPlayerCantInteractAnyMore(): void; - setCanInteractThroughColliders(canInteract: boolean): void; - setForceDisabled(forceDisabled: boolean): void; - setInfo(info: any): void; - remove(zone: CircleShort | Rect): void; - onInteraction?(): void; + interface TileToRemove { + depth: number; + id: string; + x: number; + y: number; } - - interface DeviceInput { - device: Device; - enabled: boolean; - hasKeyListeners: boolean; - isCurrentlyUnderMouse: boolean; - addDeviceToCursorUnderList(): void; - createKeyListeners(): void; - cutCopyHandler(action: string): void; - disable(): void; - dispose(): void; - disposeKeyListeners(): void; - enable(): void; - partIsNoLongerUnderMouse(): void; - partIsUnderMouse(): void; - removeDeviceFromCursorUnderList(): void; + interface Removing { + deviceIdToRemove?: string; + removingMode: string; + removingTilesEraserSize: number; + removingTilesLayer: number; + removingTilesMode: string; + tilesToRemove: TileToRemove[]; + wireIdToRemove?: string; } - - interface DeviceUI { - device: Device; - close(): void; - open(options: Record): void; - update(options: Record): void; + interface MeSpectating { + id: string; + name: string; + shuffle: boolean; } - - interface VFX { - character: Character; - damageBoostActive: boolean; - phaseActive: boolean; - tintModifierId: string; - transparencyModifierId: string; - setTintModifier(id: string): void; - setTransparencyModifier(id: string): void; - startDamageBoostAnim(): void; - startPhaseAnim(): void; - stopDamageBoostAnim(): void; - stopPhaseAnim(): void; + interface XPAddition { + amount: number; + reason: string; + xp: number; } - - interface TintParams { - type: string; - fromColor: string; - toColor: string; - duration: number; - tween?: import("phaser").Tweens.Tween; - ease(t: number): number; + interface XP { + additionTimeouts: Map>; + additions: XPAddition[]; + showingLevelUp: boolean; } - - interface Tint { - character: Character; - scene: Scene; - phase?: TintParams; - playerAppearanceModifierDevice?: TintParams; - immunity?: TintParams; - damageBoost?: TintParams; - getTintParams(type: string): TintParams | undefined; - setTintParams(type: string, tint?: TintParams): void; - startAnimateTint(params: TintParams): void; - stopAnimateTint(type: string): void; - update(): void; + interface ZoneDropOverrides { + allowItemDrop: boolean; + allowResourceDrop: boolean; + allowWeaponDrop: boolean; } - - interface SkinSetupOptions extends SkinOptions { - x?: number; - y?: number; + interface Me { + adding: Adding; + cinematicMode: CinematicMode; + classDesigner: ClassDesigner; + completedInitialPlacement: boolean; + context: Context; + currentAction: string; + customAssets: MeCustomAssets; + deviceUI: MeDeviceUI; + editing: Editing; + gotKicked: boolean; + health: Health; + interactives: Interactives; + inventory: Inventory; + isRespawning: boolean; + mobileControls: MobileControls; + mood: Mood; + movementSpeed: number; + myTeam: string; + nonDismissMessage: NonDismissMessage; + phase: boolean; + preferences: { + startGameWithMode: string; + }; + properties: Map; + removing: Removing; + roleLevel: number; + spawnPosition: Vector; + spectating: MeSpectating; + teleportCount: number; + unredeemeedXP: number; + xp: XP; + zoneDropOverrides: ZoneDropOverrides; } - - interface SkinOptions { + interface CallToActionCategory { id: string; - editStyles?: Record; + name: string; + plural: string; } - - interface Skin { - character: Character; - editStyles?: Record; - latestSkinId: string; - scene: Scene; - skinId: string; - applyEditStyles(options: SkinOptions): void; - setupSkin(position: SkinSetupOptions): void; - updateSkin(options: SkinOptions): void; - } - - interface Shadow { - character: Character; - image?: import("phaser").GameObjects.Image; - createShadow(): void; - destroy(): void; - update(): void; - } - - interface TweenScaleOptions { - type: string; - scale: number; - duration: number; - } - - interface Scale { - activeScale: number; - baseScale: number; - character: Character; - respawningScale: number; - scaleX: number; - scaleY: number; - scene: Scene; - spectatorScale: number; - dependencyScale: number; - isVisible: boolean; - getCurrentScale(type: number): void; - onSkinChange(): void; - setScale(type: number, scale: number): void; - tweenScale(options: TweenScaleOptions): void; - update(): void; - } - - interface Position { - character: Character; - update(dt: number): void; - } - - interface Network { - lastAngle?: number; - lastAngleUpdate: number; - updateAimAngle(angle: number): void; - } - - interface Nametag { - alpha: number; - character: Character; - creatingTag: boolean; - depth: number; - destroyed: boolean; - followScale: boolean; - fragilityTag?: import("phaser").GameObjects.Text; - healthMode: string; + interface CallToActionItem { + id: string; + category: string; name: string; - scale: number; - scene: Scene; - tag: import("phaser").GameObjects.Text; - teamState: TeamState; - fontColor: string; - tags: import("phaser").GameObjects.Text[]; - createFragilityTag(): void; - createTag(): void; - destroy(): void; - makeVisibleChanges(force?: boolean): void; - playHideAnimation(): void; - playShowUpAnimation(): void; - setName(name: string): void; - update(update: { - teamState: TeamState; - }): void; - updateFontColor(): void; - updateFragility(fragility: number): void; - updateTagAlpha(force?: boolean): void; - updateTagDepth(force?: boolean): void; - updateTagPosition(force?: boolean): void; - updateTagScale(force?: boolean): void; - } - - interface CharacterInput { - character: Character; - isListeningForInput: boolean; - scene: Scene; - setupInput(): void; + url: string; } - - interface TeamState { - status: string; - teamId: string; + interface Widget { + type: string; + id: string; + y: number; + placement: string; + statName: string; + statValue: number; } - - interface Indicator extends Updates { - character: Character; - characterHeight: number; - depth: number; - image: import("phaser").GameObjects.Image; - isMain: boolean; - isSpectated: boolean; - lastCharacterAlpha: number; - scene: Scene; - teamState: TeamState; - destroy(): void; - makeIndicator(): void; + interface GameSession { + callToAction: { + categories: CallToActionCategory[]; + items: CallToActionItem[]; + }; + countdownEnd: number; + phase: string; + resultsEnd: number; + widgets: { + widgets: Widget[]; + }; } - - interface ImpactAnimation { - animations: Map; - character: Character; - loadedAnimations: Set; - scene: Scene; - _play(animation: string): void; - destroy(): void; - load(animation: string): void; - play(animation: string): void; + interface Session { + allowGoogleTranslate: boolean; + amIGameOwner: boolean; + canAddGameTime: boolean; + cosmosBlocked: boolean; + customTeams: { + characterToTeamMap: Map; + }; + duringTransition: boolean; + gameClockDuration: string; + gameOwnerId: string; + gameSession: GameSession; + gameTime: number; + gameTimeLastUpdateAt: number; + globalPermissions: Permissions; + loadingPhase: boolean; + mapCreatorRoleLevel: number; + mapStyle: string; + modeType: string; + ownerRole: string; + phase: string; + phaseChangedAt: number; + version: string; } - - interface Immunity { - character: Character; - classImmunityActive: boolean; - spawnImmunityActive: boolean; - activate(): void; - activateClassImmunity(): void; - activateSpawnImmunity(): void; - deactivate(): void; - deactivateClassImmunity(): void; - deactivateSpawnImmunity(): void; - isActive(): boolean; + interface Achievement { + id: string; + key: string; + reset: () => void; + update: () => void; } - - interface Updates { - update(update: { - delta: number; - }): void; - updateAlpha(): void; - updateDepth(): void; - updatePosition(dt: number): void; - updateScale(): void; + interface BottomInGamePrimaryContent { + interactionWantsToBeVisible: boolean; + prioritizeInteraction: boolean; } - - interface Healthbar extends Updates { - character: Character; - depth: number; - isVisible: boolean; - scene: Scene; - destroy(): void; - makeIndicator(): void; - updateValue(): void; + interface DamageIndicator { + show: boolean; + /** `h` for red, `s` for blue, and any other string for yellow. */ + type: string; } - - interface Flip { - character: Character; - flipXLastX: number; - isFlipped: boolean; - lastX: number; - lastY: number; - update(): void; - updateFlipForMainCharacter(): void; - updateFlipForOthers(): void; + interface GuiSlot { + id: string; + position: string; + text: string; + trackedItemId: string | null; + showTrackedItemMaximumAmount: boolean; + type: string; + priority: number; + color: string; } - - interface Dimensions { - character: Character; - currentDimensionsId: string; - bottomY: number; - centerX: number; - topY: number; - x: number; - onPotentialDimensionsChange(): void; + interface KnockoutAlert { + id: string; + name: string; } - - interface Depth { - character: Character; - currentDepth: number; - lastY: number; - update(): void; - updateDepth(): void; + interface Modals { + closeAllModals: () => void; + cosmosModalOpen: boolean; + switchToRegisterScreenWhenCosmosModalOpens: boolean; } - - interface Culling { - character: Character; - isInCamera: boolean; - needsCullUpdate: boolean; - scene: Scene; - shouldForceUpdate: boolean; - forceUpdate(): void; - hideObject(object: any): void; - onInCamera(): void; - onOutCamera(): void; - showObject(object: any): void; - updateNeedsUpdate(): void; + interface NoneGui { + addMenu: { + screen: string; + }; + duringGameScreenVisible: boolean; + optionsMenu: { + screen: string; + }; + screen: string; } - - interface TrailParticles { - frameHeight: number; - frameWidth: number; - imageUrl: string; - numberOfFrames: number; + interface Scorebar { + teamColors: string[]; + teams: string[]; } - - interface TrailEmitter { - frequency: number; - quantity: number; - blendMode: number; - speed: number; - speedVariation: number; - lifetime: number; - lifetimeVariation: number; + interface GUI { + achievement: Achievement; + bottomInGamePrimaryContent: BottomInGamePrimaryContent; + damageIndicator: DamageIndicator; + guiSlots: GuiSlot[]; + guiSlotsChangeCounter: number; + knockoutAlerts: KnockoutAlert[]; + modals: Modals; + none: NoneGui; + openInputBlockingUI: string[]; + playersManagerUpdateCounter: number; scale: number; - scaleVariation: number; - scaleThreshold: number; - rotationRandomAtStart: boolean; - rotationChange: number; - rotationChangeVariation: number; - rotationAllowNegativeChange: boolean; - alphaThresholdStart: number; - alphaThresholdEnd: number; - gravityY: number; - yOriginChange: number; - emitterZone: Partial; - } - - interface TrailAppearance { - id: string; - emitter: TrailEmitter; - particles: TrailParticles; + scorebar?: Scorebar; + selectedPlayerId: string; + showingGrid: boolean; } - - interface CharacterTrail { - character: Character; - currentAppearance: TrailAppearance; - currentAppearanceId: string; - isReady: boolean; - lastSetAlpha: number; - destroy(): void; - followCharacter(): void; - setNewAppearance(appearance: TrailAppearance): void; - update(): void; - updateAppearance(id: string): void; + interface CharacterPermissions { + adding: boolean; + editing: boolean; + manageCodeGrids: boolean; + removing: boolean; } - - interface TweenAlphaOptions { - alpha: number; + interface CharacterInfo { + allowWeaponFire: boolean; + existsBeforeReconnect: boolean; + fragility: number; + health: number; + id: string; + isActive: boolean; + lastPlayersTeamId: string; + name: string; + permissions: CharacterPermissions; + score: number; + teamId: string; type: string; - duration: number; - ease?: string; - } - - interface Alpha { - character: Character; - cinematicModeAlpha: number; - currentAlpha: number; - immunity: number; - phaseAlpha: number; - playerAppearanceModifierDeviceAlpha: number; - scene: Scene; - getCurrentAlpha(): number; - setAlpha(type: string, alpha: number): void; - tweenAlpha(options: TweenAlphaOptions): void; - update(): void; - } - - interface EndInfo { - end: number; - start: number; - x: number; - y: number; - } - - interface Point { - endTime: number; - endX: number; - endY: number; - startTime: number; - startX: number; - startY: number; - teleported: boolean; - usedTeleported: boolean; } - - interface Movement { - character: Character; - currentPoint: Point; - currentTime: number; - nonMainCharacterGrounded: boolean; - pointMap: Point[]; - targetIsDirty: boolean; - targetNonMainCharacterGrounded: boolean; - targetX: number; - targetY: number; - teleportCount: number; - teleported: boolean; - getCurrentEndInfo(): EndInfo; - moveToTargetPosition(): void; - onMainCharacterTeleport(): void; - postPhysicsUpdate(dt: number): void; - setNonMainCharacterTargetGrounded(grounded: boolean): void; - setTargetX(x: number): void; - setTargetY(y: number): void; - setTeleportCount(teleportCount: number): void; - update(dt: number): void; - } - - interface NonMainCharacterState { - grounded: boolean; + interface Characters { + characters: Map; } - - interface Animation { - availableAnimations: string[]; - blinkTimer: number; - bodyAnimationLocked: boolean; - bodyAnimationStartedAt: number; - character: Character; - currentBodyAnimation: string; - currentEyeAnimation: string; - lastGroundedAnimationAt: number; - nonMainCharacterState: NonMainCharacterState; - prevNonMainCharacterState: NonMainCharacterState; - skinChanged: boolean; - destroy(): void; - onAnimationComplete(options: any): void; - onSkinChanged(): void; - playAnimationOrClearTrack(animations: string[], track: number): void; - playBodyAnimation(animation: string): void; - playBodySupplementalAnimation(animation: string): void; - playEyeAnimation(animation: string): void; - playJumpSupplementalAnimation(animation: string): void; - playMovementSupplementalAnimation(animation: string): void; - setupAnimations(): void; - startBlinkAnimation(): void; - stopBlinkAnimation(): void; - update(dt: number): void; + interface Costs { + codeGrid: number; + collidingTile: number; + customAssetDefault: number; + deviceInitialDefault: number; + deviceSubsequentDefault: number; + nonCollidingTile: number; + wire: number; } - - interface ProjectileAppearance { - imageUrl: string; - rotateToTarget: boolean; - scale: number; + interface Counters { + codeGrids: number; + collidingTiles: number; + customAssets: Map; + devices: Map; + nonCollidingTiles: number; + wires: number; } - - interface WeaponAsset extends BaseAsset { - fireFrames: number[]; - fromCharacterCenterRadius: number; - hideFireSlash: boolean; - idleFrames: number; - originX: number; - originY: number; + interface Limits { + blocksPerCodeGrid: number; + codeGrids: number; + codeGridsPerDevice: number; + collidingTiles: number; + customAssetOnMapDefault: number; + deviceMaxOnMapDefault: number; + nonCollidingTiles: number; + wires: number; } - - interface BaseAsset { - frameHeight: number; - frameRate: number; - frameWidth: number; - imageUrl: string; - scale: number; + interface MemorySystem { + costs: Costs; + counters: Counters; + limits: Limits; + maxUsedMemory: number; + usedMemoryCost: number; } - - interface ImpactAsset extends BaseAsset { - frames: number[]; - hideIfNoHit?: boolean; + interface Rect { + x: number; + y: number; + width: number; + height: number; } - - interface SoundEffect { - path: string; - volume: number; + interface RotatedRect extends Rect { + angle: number; } - - interface CurrentAppearance { - id: string; - explosionSfx: SoundEffect[]; - fireSfx: SoundEffect[]; - impact: ImpactAsset; - projectile: ProjectileAppearance; - reloadSfx: SoundEffect; - weapon: WeaponAsset; + interface Circle { + x: number; + y: number; + radius: number; } - - interface AimingAndLookingAround { - angleTween?: import("phaser").Tweens.Tween; - character: Character; - currentAngle?: number; - currentAppearance?: CurrentAppearance; - currentWeaponId?: string; - isAiming: boolean; - lastUsedAngle: number; - sprite: import("phaser").GameObjects.Sprite; - targetAngle?: number; - characterShouldFlipX(): boolean; - destroy(): void; - isCurrentlyAiming(): boolean; - onInventoryStateChange(): void; - playFireAnimation(): void; - setImage(appearance: CurrentAppearance): void; - setSpriteParams(skipRecalculateAlpha: boolean): void; - setTargetAngle(angle: number, instant?: boolean): void; - update(): void; - updateAnotherCharacter(): void; - updateMainCharacterMouse(): void; - updateMainCharacterTouch(): void; + interface RotatedCircle extends Circle { + angle: number; } - - interface ServerPosition { - packet: number; + interface Ellipse { x: number; y: number; - jsonState: string; - teleport: boolean; + r1: number; + r2: number; } - - interface Bodies { - character: Character; - collider: Collider; - colliderDesc: ColliderDesc; - rigidBody: RigidBody; - rigidBodyDesc: RigidBodyDesc; + interface RotatedEllipse extends Ellipse { + angle: number; } - - interface PhysicsInput { - _jumpKeyPressed: boolean; - activeClassDeviceId: string; + interface RectShort { + x: number; + y: number; + w: number; + h: number; + } + interface RotatedRectShort extends RectShort { angle: number; - ignoredStaticBodies: Set; - ignoredTileBodies: Set; - jump: boolean; - projectileHitForcesQueue: Set; } - - interface MovementState { - accelerationTicks: number; - direction: string; - xVelocity: number; + interface CircleShort { + x: number; + y: number; + r: number; } - - interface Jump { - /** Optional in top-down, required in platformer */ - actuallyJumped?: boolean; - isJumping: boolean; - jumpCounter: number; - jumpTicks: number; - jumpsLeft: number; - xVelocityAtJumpStart: number; + interface CodeGrids { + blockCategories: string; + customBlocks: string; + customBlocksParsed: any[]; } - - interface PhysicsState { - forces: any[]; - gravity: number; - grounded: boolean; - groundedTicks: number; - jump: Jump; - lastGroundedAngle: number; - movement: MovementState; - velocity: Vector; + interface OptionSchema { + options: any[]; + categories?: any[]; } - - interface Physics { - character: Character; - currentPacketId: number; - frameInputsHistory: Map; - justAppliedProjectileHitForces: Set; - lastClassDeviceActivationId: number; - lastPacketSent: number[]; - lastSentClassDeviceActivationId: number; - lastSentTerrainUpdateId: number; - lastTerrainUpdateId: number; - newlyAddedTileBodies: Set; - phase: boolean; - physicsBodyId: string; - prevState: PhysicsState; - projectileHitForcesHistory: Map; - projectileHitForcesQueue: Set; - scene: Scene; - state: PhysicsState; - tickInput: TickInput; - destroy(): void; - getBody(): Bodies; - postUpdate(dt: number): void; - preUpdate(): void; - sendToServer(): void; - setServerPosition(serverPosition: ServerPosition): void; - setupBody(x: number, y: number): void; - updateDebugGraphics(): void; + interface DeviceInfo { + id: string; + name: string; + description?: string; + optionSchema: OptionSchema; + defaultState: any; + codeGridSchema: CodeGridSchema; + wireConfig?: any; + minimumRoleLevel?: number; + maxOnMap?: number; + initialMemoryCost?: number; + subsequentMemoryCost?: number; + supportedMapStyles?: string[]; + seasonTicketRequired?: boolean; + maximumRoleLevel?: number; } - - interface Character { - aimingAndLookingAround: AimingAndLookingAround; - alpha: Alpha; - animation: Animation; - body: Vector; - characterTrail: CharacterTrail; - culling: Culling; - depth: Depth; - dimensions: Dimensions; - flip: Flip; - healthbar: Healthbar; + interface ItemOption { + type: string; id: string; - immunity: Immunity; - impactAnimation: ImpactAnimation; - indicator: Indicator; - input: CharacterInput; - isActive: boolean; - isDestroyed: boolean; - isMain: boolean; - movement: Movement; - nametag: Nametag; - network: Network; - physics: Physics; - position: Position; - prevBody: Vector; - scale: Scale; - scene: Scene; - shadow: Shadow; - skin: Skin; - spine: any; - teamId: string; - tint: Tint; + name: string; + editorName: string; + description: string; + previewImage: string; + rarity?: string; + weapon?: Weapon; + minimumRoleLevel?: number; + useCommand?: string; + consumeType?: string; + terrainId?: string; + maxStackSize?: number; + } + interface Weapon { type: string; - vfx: VFX; - destroy(): void; - setIsMain(isMain: boolean): void; - update(dt: number): void; + appearance: string; + shared: WeaponShared; + bullet?: { + ammoItemId: string; + }; + } + interface WeaponShared { + cooldownBetweenShots: number; + allowAutoFire: boolean; + startingProjectileDistanceFromCharacter: number; + } + interface PropOption { + id: string; + name: string; + scaleMultip: number; + originX: number; + originY: number; + imageUrl: string; + rectColliders: RotatedRectShort[]; + circleColliders: CircleShort[]; + ellipseColliders: RotatedEllipse[]; + shadows: Ellipse[]; + seasonTicketRequired?: boolean; + minimumRoleLevel?: number; + defaultLayer?: string; + } + interface SkinOption { + id: string; + name: string; + minimumRoleLevel?: number; + } + interface TerrainOption { + id: string; + name: string; + maskTilesUrl: string; + borderTilesUrl: string; + fillUrl: string; + blockedMapStyles?: string[]; + seasonTicketRequired?: boolean; + previewUrl: string; + health?: number; + minimumRoleLevel?: number; + } + interface CustomAssetOption { + id: string; + maxOnMap: number; + memoryCost: number; + minimumRoleLevel?: number; + validate: any; } - - interface UpdateCullOptions { - mainCharacter: Character; - isPhase: boolean; - insideView: boolean; + interface WorldOptions { + codeGrids: CodeGrids; + customAssetsOptions: CustomAssetOption[]; + deviceOptions: DeviceInfo[]; + hasAllProps: boolean; + itemOptions: ItemOption[]; + propsOptions: PropOption[]; + skinOptions: SkinOption[]; + terrainOptions: TerrainOption[]; } - - interface Cull { + interface AppearanceVariation { device: Device; - ignoresCull: boolean; - isInsideView: boolean; - margin: number; - wasInsideView: boolean; - getMargin(): number; - ignoreCulling(): void; - setMargin(margin: number): void; - setOnEnterViewCallback(callback: () => void): void; - setOnLeaveViewCallback(callback: () => void): void; - onEnterViewCallback?(): void; - onLeaveViewCallback?(): void; - updateCull(options: UpdateCullOptions): void; + resetAppearance(): void; + setPreviewAppearance(): void; + setRemovalAppearance(): void; + } + interface BoundingBox { + cachedBoundingBox: Rect; + device: Device; + hardcodedBoundingBox?: Rect; + clearCached(): void; + clearHardcoded(): void; + getBoundingBox(): Rect; + isHardcoded(): boolean; + isInsideBoundingBox(x: number, y: number): boolean; + setHardcoded(rect: Rect): void; } - type DeviceCollider = RectShort | CircleShort | Ellipse; - type ColliderOptions = { device: Device; scene: Scene; @@ -1088,14 +728,12 @@ declare global { x: number; y: number; } & Partial; - interface ColliderEntry { bodyId: string; options: ColliderOptions; device: Device; scene: Scene; } - interface Colliders { add: { box(collider: RectShort): void; @@ -1110,33 +748,145 @@ declare global { hideDebug(): void; showDebug(): void; } - - interface Rect { - x: number; - y: number; + interface UpdateCullOptions { + mainCharacter: Character; + isPhase: boolean; + insideView: boolean; + } + interface Cull { + device: Device; + ignoresCull: boolean; + isInsideView: boolean; + margin: number; + wasInsideView: boolean; + getMargin(): number; + ignoreCulling(): void; + setMargin(margin: number): void; + setOnEnterViewCallback(callback: () => void): void; + setOnLeaveViewCallback(callback: () => void): void; + onEnterViewCallback?(): void; + onLeaveViewCallback?(): void; + updateCull(options: UpdateCullOptions): void; + } + interface DeviceUI { + device: Device; + close(): void; + open(options: Record): void; + update(options: Record): void; + } + interface DeviceInput { + device: Device; + enabled: boolean; + hasKeyListeners: boolean; + isCurrentlyUnderMouse: boolean; + addDeviceToCursorUnderList(): void; + createKeyListeners(): void; + cutCopyHandler(action: string): void; + disable(): void; + dispose(): void; + disposeKeyListeners(): void; + enable(): void; + partIsNoLongerUnderMouse(): void; + partIsUnderMouse(): void; + removeDeviceFromCursorUnderList(): void; + } + interface InteractiveZones { + add: { + circle(zone: CircleShort): void; + rect(zone: Rect): void; + }; + canInteractThroughColliders: boolean; + device: Device; + forceDisabled: boolean; + zones: (CircleShort | Rect)[]; + contains(x: number, y: number): boolean; + destroy(): void; + getCanInteractThroughColliders(): boolean; + getInfo(): any; + getMaxDistance(x: number, y: number): number; + isInteractive(): boolean; + onPlayerCanInteract(): void; + onPlayerCantInteractAnyMore(): void; + setCanInteractThroughColliders(canInteract: boolean): void; + setForceDisabled(forceDisabled: boolean): void; + setInfo(info: any): void; + remove(zone: CircleShort | Rect): void; + onInteraction?(): void; + } + interface VisualEditingBox { width: number; height: number; + angle: number; + minWidth: number; + maxWidth: number; + minHeight: number; + maxHeight: number; + keepRatio: boolean; + rotable: boolean; + onChange(value: RotatedRect): void; } - - interface BoundingBox { - cachedBoundingBox: Rect; + interface VisualEditingCircle { + angle: number; + rotable: boolean; + radius: number; + minRadius: number; + maxRadius: number; + onChange(value: RotatedCircle): void; + } + interface DeviceVisualEditing { + add: { + box(options: VisualEditingBox): void; + circle(options: VisualEditingCircle): void; + }; device: Device; - hardcodedBoundingBox?: Rect; - clearCached(): void; - clearHardcoded(): void; - getBoundingBox(): Rect; - isHardcoded(): boolean; - isInsideBoundingBox(x: number, y: number): boolean; - setHardcoded(rect: Rect): void; + isActive: boolean; + shapes: (VisualEditingBox | VisualEditingCircle)[]; + clear(): void; } - - interface AppearanceVariation { + interface ShadowOptions { + x: number; + y: number; + r1: number; + r2: number; + alphaMultip: number; + depth: number; + } + interface Shadows { device: Device; - resetAppearance(): void; - setPreviewAppearance(): void; - setRemovalAppearance(): void; + list: ShadowOptions[]; + add(options: ShadowOptions): void; + destroy(): void; + forEach(callback: (shadow: ShadowOptions) => void): void; + hide(): void; + show(): void; + } + interface Layers { + depth: number; + device: Device; + layer: string; + options: any; + } + interface WirePoints { + device: Device; + end: Vector; + start: Vector; + onPointChange(): void; + setBoth(x: number, y: number): void; + } + interface DeviceTweens { + list: Tweens.Tween[]; + device: Device; + add(config: Types.Tweens.TweenBuilderConfig): Tweens.Tween; + destroy(): void; + } + interface DeviceProjectiles { + device: Device; + addToDynamicDevices(): void; + collidesWithProjectile(object: Circle): boolean; + onClientPredictedHit(position: Vector): void; + removeFromDynamicDevices(): void; + setDynamic(dynamic: boolean): void; } - interface BaseDevice { isPreview: boolean; placedByClient: boolean; @@ -1190,115 +940,97 @@ declare global { isBeingReplaced: boolean; }): void; } - type Device = BaseDevice & { [key: string]: any; }; - - interface Cameras { - allCameras: Device[]; - allCamerasNeedsUpdate: boolean; - camerasPlayerIsInside: any[]; - scene: Scene; - wasInPrePhase: boolean; - findNewCameras(allCameras: Device[], x: number, y: number): any; - setCurrentCameraSizeDevice(device: Device): void; - switchToDefaultCameraSize(reset: boolean): void; - update(devices: Device[]): void; + interface Jump { + /** Optional in top-down, required in platformer */ + actuallyJumped?: boolean; + isJumping: boolean; + jumpCounter: number; + jumpTicks: number; + jumpsLeft: number; + xVelocityAtJumpStart: number; } - - interface Devices { - allDevices: Device[]; - cameras: Cameras; - devicesAction: DevicesAction; - devicesInView: Device[]; - devicesPreview: DevicesPreview; - devicesToPostUpdate: Set; - devicesToUpdate: Set; - interactives: WorldInteractives; - scene: Scene; - visualEditingManager: any; - addDevice(device: Device): void; - cullDevices(): void; - findDeviceUnderMouse(): Device | undefined; - getDeviceById(id: string): Device | undefined; - hasDevice(id: string): boolean; - removeDeviceById(id: string, options: { - isBeingReplaced: boolean; - }): void; - update(dt: number): void; + interface MovementState { + accelerationTicks: number; + direction: string; + xVelocity: number; + } + interface PhysicsState { + forces: any[]; + gravity: number; + grounded: boolean; + groundedTicks: number; + jump: Jump; + lastGroundedAngle: number; + movement: MovementState; + velocity: Vector; } - - interface WorldManager { - devices: Devices; - inGameTerrainBuilder: InGameTerrainBuilder; - physics: PhysicsManager; - projectiles: Projectiles; - scene: Scene; - terrain: any; - wires: any; - update(dt: number): void; + interface PhysicsInput extends TickInput { + activeClassDeviceId: string; + ignoredStaticBodies: Set; + ignoredTileBodies: Set; + projectileHitForcesQueue: Set; } - - interface MovementPointer { + interface CharacterBody { id: string; - x: number; - y: number; - downX: number; - downY: number; + ignoredStaticBodies: Set; + ignoredTileBodies: Set; + controller: KinematicCharacterController; + aroundSensor: Collider; + feetSensor: Collider; } - - interface Mouse { - clickListeners: Map void>; - downX: number; - downY: number; - isHoldingDown: boolean; - movementPointer?: MovementPointer; - scene: Scene; - stopRunningClickHandlers: boolean; - worldX: number; - worldY: number; + interface Bodies { + character: CharacterBody; + collider: Collider; + colliderDesc: ColliderDesc; + rigidBody: RigidBody; + rigidBodyDesc: RigidBodyDesc; + } + interface ServerPosition { + packet: number; x: number; y: number; - addClickListener(options: { - callback: (pointer: import("phaser").Input.Pointer) => void; - }): () => void; - pointerUpdate(pointer: import("phaser").Input.Pointer): void; - removeClickListener(id: string): void; - shouldBecomeMovementPointer(pointer: import("phaser").Input.Pointer): boolean; - } - - interface KeyboardState { - isHoldingDown: boolean; - isHoldingLeft: boolean; - isHoldingRight: boolean; - isHoldingUp: boolean; - isHoldingSpace: boolean; - } - - interface Keyboard { - heldKeys: Set; - scene: Scene; - state: KeyboardState; - createListeners(): void; - isKeyDown(key: number): boolean; + jsonState: string; + teleport: boolean; } - - interface PressedKeys { - up: boolean; - down: boolean; - left: boolean; - right: boolean; + type AngleInput = number | null; + interface TickInput { + angle: AngleInput; + jump: boolean; + _jumpKeyPressed: boolean; } - - interface Cursor { + interface Physics { + character: Character; + currentPacketId: number; + frameInputsHistory: Map; + justAppliedProjectileHitForces: Set; + lastClassDeviceActivationId: number; + lastPacketSent: number[]; + lastSentClassDeviceActivationId: number; + lastSentTerrainUpdateId: number; + lastTerrainUpdateId: number; + newlyAddedTileBodies: Set; + phase: boolean; + physicsBodyId: string; + prevState: PhysicsState; + projectileHitForcesHistory: Map; + projectileHitForcesQueue: Set; scene: Scene; - createStateListeners(): void; - updateCursor(): void; + state: PhysicsState; + tickInput: TickInput; + destroy(): void; + getBody(): Bodies; + postUpdate(dt: number): void; + preUpdate(): void; + sendToServer(): void; + setServerPosition(serverPosition: ServerPosition): void; + setupBody(x: number, y: number): void; + updateDebugGraphics(): void; } - interface AimCursor { - aimCursor: import("phaser").GameObjects.Sprite; + aimCursor: GameObjects.Sprite; aimCursorWorldPos: Vector; centerShiftX: number; centerShiftY: number; @@ -1307,867 +1039,939 @@ declare global { y: number; update(): void; } - - interface TickInput { - angle: number | null; - jump: boolean; - _jumpKeyPressed: boolean; - } - - interface InputManager { - aimCursor: AimCursor; - currentInput: TickInput; - cursor: Cursor; - isListeningForInput: boolean; - jumpedSinceLastPhysicsFetch: boolean; - keyboard: Keyboard; - mouse: Mouse; - physicsInputHandledBetweenUpdates: boolean; - scene: Scene; - getAimingDirection(): Vector; - getInputAngle(): number | null; - getKeys(): PressedKeys; - getMouseWorldXY(): Vector; - getPhysicsInput(): TickInput; - refreshInput(): void; - update(): void; - } - - interface Scene extends BaseScene { - actionManager: ActionManager; - cameraHelper: any; - characterManager: CharacterManager; - dt: number; - inputManager: InputManager; - resizeManager: any; - shadowsManager: any; - spine: any; - tileManager: TileManager; - uiManager: any; - worldManager: WorldManager; - create(): void; - } - - interface Phaser { - mainCharacter: Character; - mainCharacterTeleported: boolean; + interface Cursor { scene: Scene; + createStateListeners(): void; + updateCursor(): void; } - - interface NetworkStore { - attemptingToConnect: boolean; - attemptingToReconnect: boolean; - authId: string; - client: any; - clientConnectionString: string; - error: any; - errorFindingServerForGame: boolean; - errorJoiningRoom: boolean; - failedToReconnect: boolean; - findingServerForGame: boolean; - hasJoinedRoom: boolean; - isOffline: boolean; - isUpToDateWithPingPong: boolean; - joinedRoom: boolean; - phaseBeforeReconnect: string | null; - ping: number; - room: any; - roomIntentErrorMessage: string; - syncingAfterReconnection: boolean; - } - - interface Matchmaker { - gameCode: string; - } - - interface Loading { - completedInitialLoad: boolean; - loadedInitialDevices: boolean; - loadedInitialTerrain: boolean; - percentageAssetsLoaded: number; - } - - interface Hooks { - hookJSON: string; - } - - interface EditingStore { - accessPoints: Map; - gridSnap: number; - showMemoryBarAtAllTimes: boolean; - } - - interface Assignment { - hasSavedProgress: boolean; - objective: string; - percentageComplete: number; - } - - interface ActivityFeed { - feedItems: { - id: string; - message: string; - }[]; + interface PressedKeys { + up: boolean; + down: boolean; + left: boolean; + right: boolean; } - - interface CustomAssetOption { - id: string; - maxOnMap: number; - memoryCost: number; - minimumRoleLevel?: number; - validate: any; + interface KeyboardState { + isHoldingDown: boolean; + isHoldingLeft: boolean; + isHoldingRight: boolean; + isHoldingUp: boolean; + isHoldingSpace: boolean; } - - interface TerrainOption { - id: string; - name: string; - maskTilesUrl: string; - borderTilesUrl: string; - fillUrl: string; - blockedMapStyles?: string[]; - seasonTicketRequired?: boolean; - previewUrl: string; - health?: number; - minimumRoleLevel?: number; + interface Keyboard { + heldKeys: Set; + scene: Scene; + state: KeyboardState; + createListeners(): void; + isKeyDown(key: number): boolean; } - - interface SkinOption { + interface MovementPointer { id: string; - name: string; - minimumRoleLevel?: number; - } - - interface CircleShort { x: number; y: number; - r: number; + downX: number; + downY: number; } - - interface RectShort { + interface Mouse { + clickListeners: Map void>; + downX: number; + downY: number; + isHoldingDown: boolean; + movementPointer?: MovementPointer; + scene: Scene; + stopRunningClickHandlers: boolean; + worldX: number; + worldY: number; x: number; y: number; - w: number; - h: number; - } - - interface RotatedRectShort extends RectShort { - angle: number; + addClickListener(options: { + callback: (pointer: Input.Pointer) => void; + }): () => void; + pointerUpdate(pointer: Input.Pointer): void; + removeClickListener(id: string): void; + shouldBecomeMovementPointer(pointer: Input.Pointer): boolean; } - - interface RotatedEllipse extends Ellipse { - angle: number; + interface InputManager { + aimCursor: AimCursor; + angleSinceLastPhysicsFetch: AngleInput; + currentInput: TickInput; + cursor: Cursor; + isListeningForInput: boolean; + jumpedSinceLastPhysicsFetch: boolean; + keyboard: Keyboard; + mouse: Mouse; + physicsInputHandledBetweenUpdates: boolean; + scene: Scene; + getAimingDirection(): Vector; + getInputAngle(): number | null; + getKeys(): PressedKeys; + getMouseWorldXY(): Vector; + getPhysicsInput(): TickInput; + refreshInput(): void; + update(): void; } - - interface Ellipse { - x: number; - y: number; - r1: number; - r2: number; + interface Cameras { + allCameras: Device[]; + allCamerasNeedsUpdate: boolean; + camerasPlayerIsInside: any[]; + scene: Scene; + wasInPrePhase: boolean; + findNewCameras(allCameras: Device[], x: number, y: number): any; + setCurrentCameraSizeDevice(device: Device): void; + switchToDefaultCameraSize(reset: boolean): void; + update(devices: Device[]): void; } - - interface PropOption { - id: string; - name: string; - scaleMultip: number; - originX: number; - originY: number; - imageUrl: string; - rectColliders: RotatedRectShort[]; - circleColliders: CircleShort[]; - ellipseColliders: RotatedEllipse[]; - shadows: Ellipse[]; - seasonTicketRequired?: boolean; - minimumRoleLevel?: number; - defaultLayer?: string; + interface DevicesAction { + inputManager: InputManager; + scene: Scene; + onClick(arg: any): void; + update(): void; } - - interface WeaponShared { - cooldownBetweenShots: number; - allowAutoFire: boolean; - startingProjectileDistanceFromCharacter: number; + interface DevicesPreview { + devicePreviewOverlay: Overlay; + previousDevices: Device[]; + scene: Scene; + removePreviousDevices(isBeingReplaced: boolean): void; + update(): void; } - - interface Weapon { - type: string; - appearance: string; - shared: WeaponShared; - bullet?: { - ammoItemId: string; - }; + interface WorldInteractives { + scene: Scene; + currentDevice?: Device; + clearCurrentDevice(): void; + setCurrentDevice(device: Device): void; + update(devices: Device[]): void; + canBeReachedByPlayer(device: Device): boolean; + findClosestInteractiveDevice(devices: Device[], x: number, y: number): Device | undefined; } - - interface ItemOption { - type: string; - id: string; - name: string; - editorName: string; - description: string; - previewImage: string; - rarity?: string; - weapon?: Weapon; - minimumRoleLevel?: number; - useCommand?: string; - consumeType?: string; - terrainId?: string; - maxStackSize?: number; + interface Devices { + allDevices: Device[]; + cameras: Cameras; + devicesAction: DevicesAction; + devicesInView: Device[]; + devicesPreview: DevicesPreview; + devicesToPostUpdate: Set; + devicesToUpdate: Set; + interactives: WorldInteractives; + scene: Scene; + visualEditingManager: any; + addDevice(device: Device): void; + cullDevices(): void; + findDeviceUnderMouse(): Device | undefined; + getDeviceById(id: string): Device | undefined; + hasDevice(id: string): boolean; + removeDeviceById(id: string, options: { + isBeingReplaced: boolean; + }): void; + update(dt: number): void; } - - interface OptionSchema { - options: any[]; - categories?: any[]; + interface CreateTileOptions { + x: number; + y: number; + tileIndex: number; + terrainOption: TerrainOption; } - - interface DeviceInfo { - id: string; - name: string; - description?: string; - optionSchema: OptionSchema; - defaultState: any; - codeGridSchema: CodeGridSchema; - wireConfig?: any; - minimumRoleLevel?: number; - maxOnMap?: number; - initialMemoryCost?: number; - subsequentMemoryCost?: number; - supportedMapStyles?: string[]; - seasonTicketRequired?: boolean; - maximumRoleLevel?: number; + interface InGameTerrainBuilder { + afterFailureWithTouch: boolean; + overlay: Overlay; + previewingTile?: Vector; + scene: Scene; + wasDown: boolean; + clearConsumeErrorMessage(): void; + clearPreviewLayer(): void; + createPreviewTile(options: CreateTileOptions): void; + update(): void; } - - interface CodeGrids { - blockCategories: string; - customBlocks: string; - customBlocksParsed: any[]; + interface ActiveBodies { + activeBodies: Set; + bodyManager: BodyManager; + currentCoordinateKeys: Set; + world: World; + disableBody(id: string): void; + enable(keys: Set, setAll: boolean): void; + enableBodiesAlongLine(options: { + start: Vector; + end: Vector; + }): void; + enableBodiesWithinAreas(options: { + areas: Rect[]; + disableActiveBodiesOutsideArea: boolean; + }): void; + enableBody(id: string): void; + setDirty(): void; } - - interface WorldOptions { - codeGrids: CodeGrids; - customAssetsOptions: CustomAssetOption[]; - deviceOptions: DeviceInfo[]; - hasAllProps: boolean; - itemOptions: ItemOption[]; - propsOptions: PropOption[]; - skinOptions: SkinOption[]; - terrainOptions: TerrainOption[]; + interface BodyBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; } - - interface Limits { - blocksPerCodeGrid: number; - codeGrids: number; - codeGridsPerDevice: number; - collidingTiles: number; - customAssetOnMapDefault: number; - deviceMaxOnMapDefault: number; - nonCollidingTiles: number; - wires: number; + interface BodyStatic { + bounds: BodyBounds; + cells: Set; } - - interface Counters { - codeGrids: number; - collidingTiles: number; - customAssets: Map; - devices: Map; - nonCollidingTiles: number; - wires: number; + interface GimkitBody { + collider?: Collider; + colliderDesc: ColliderDesc; + rigidBody?: RigidBody; + rigidBodyDesc: RigidBodyDesc; + static: BodyStatic; + device?: { + id: string; + }; + terrain?: { + key: string; + }; } - - interface Costs { - codeGrid: number; - collidingTile: number; - customAssetDefault: number; - deviceInitialDefault: number; - deviceSubsequentDefault: number; - nonCollidingTile: number; - wire: number; + interface BodyManager { + activeBodies: ActiveBodies; + bodies: Map; + cells: Map>; + dynamicBodies: Set; + gridSize: number; + staticBodies: Set; + staticSensorBodies: Set; + _idCount: number; + find(id: string): GimkitBody | undefined; + findPotentialStaticBodiesWithinArea(area: Rect): Set; + generateId(): void; + insert(body: GimkitBody): string; + remove(id: string): void; } - - interface MemorySystem { - costs: Costs; - counters: Counters; - limits: Limits; - maxUsedMemory: number; - usedMemoryCost: number; + interface WorldBoundsCollider { + body: RigidBody; + collider: Collider; } - - interface CharacterData { - allowWeaponFire: boolean; - existsBeforeReconnect: boolean; - fragility: number; - health: number; + interface PhysicsManager { + bodies: BodyManager; + cumulTime: number; + lastTime: number; + physicsStep(dt: number): void; + runPhysicsLoop(dt: number): void; + world: World; + worldBoundsColliders: Set; + } + interface Projectile { id: string; - isActive: boolean; - lastPlayersTeamId: string; - name: string; - permissions: Permissions; - score: number; - teamId: string; - type: string; + startTime: number; + endTime: number; + start: Vector; + end: Vector; + radius: number; + appearance: string; + ownerId: string; + ownerTeamId: string; + damage: number; + hitPos?: Vector; + hitTime?: number; } - - interface Characters { - characters: Map; + interface Projectiles { + damageMarkers: any; + dynamicDevices: Set; + fireSlashes: any; + projectileJSON: Map; + runClientSidePrediction: boolean; + scene: Scene; + addProjectile(projectile: Projectile): void; + fire(pointer: Input.Pointer, snap: boolean): void; + update(): void; } - - interface Scorebar { - teamColors: string[]; - teams: string[]; + interface WorldManager { + devices: Devices; + inGameTerrainBuilder: InGameTerrainBuilder; + physics: PhysicsManager; + projectiles: Projectiles; + scene: Scene; + terrain: any; + wires: any; + update(dt: number): void; } - - interface NoneGui { - addMenu: { - screen: string; - }; - duringGameScreenVisible: boolean; - optionsMenu: { - screen: string; - }; - screen: string; + interface BackgroundLayersManager { + layerManager: LayerManager; + scene: Scene; + createLayer(options: { + layerId: string; + depth: number; + }): void; + fill(terrain: TerrainOption): void; + fillForPlatformer(): void; + fillForTopDown(terrain: TerrainOption): void; + removeLayer(options: { + layerId: string; + }): void; } - - interface Modals { - closeAllModals: () => void; - cosmosModalOpen: boolean; - switchToRegisterScreenWhenCosmosModalOpens: boolean; + interface LayerManager { + backgroundLayersManager: BackgroundLayersManager; + colliders: Map>; + layers: Map; + scene: Scene; + createInitialLayers(): void; + createLayer(id: string): void; + fillBottomLayer(terrain: TerrainOption): void; + getActualLayerDepth(id: string): number; + moveLayersAboveCharacters(): void; + onWorldSizeChange(): void; } - - interface KnockoutAlert { - id: string; - name: string; + interface TileKey { + depth: number; + x: number; + y: number; } - - interface GuiSlot { - id: string; - position: string; - text: string; - trackedItemId: string | null; - showTrackedItemMaximumAmount: boolean; - type: string; - priority: number; - color: string; + interface TileManager { + cumulTime: number; + scene: Scene; + layerManager: LayerManager; + damageTileAtXY(x: number, y: number, depth: number, damage: number, healthPercent: number): void; + destroyTileByTileKey(tileKey: TileKey): void; + onMapStyleSet(): void; + regenerateTileAtXY(x: number, y: number, depth: number, healthPercent: number): void; + update(dt: number): void; + updateTeamColorTileAtXY(x: number, y: number, depth: number, team?: string, playerId?: string): void; } - - interface DamageIndicator { - show: boolean; - /** `h` for red, `s` for blue, and any other string for yellow. */ - type: string; + interface ShowOverlayOptions { + x: number; + y: number; + width: number; + height: number; + depth: number; } - - interface BottomInGamePrimaryContent { - interactionWantsToBeVisible: boolean; - prioritizeInteraction: boolean; + interface Overlay { + scene: Scene; + showing: boolean; + showingDimensions: { + width: number; + height: number; + } | null; + showingPosition: { + x: number; + y: number; + } | null; + hide(): void; + show(options: ShowOverlayOptions): void; } - - interface Achievement { - id: string; - key: string; - reset: () => void; - update: () => void; + interface DepthSort { + overlay: Overlay; + scene: Scene; + update(): void; } - - interface GUI { - achievement: Achievement; - bottomInGamePrimaryContent: BottomInGamePrimaryContent; - damageIndicator: DamageIndicator; - guiSlots: GuiSlot[]; - guiSlotsChangeCounter: number; - knockoutAlerts: KnockoutAlert[]; - modals: Modals; - none: NoneGui; - openInputBlockingUI: string[]; - playersManagerUpdateCounter: number; - scale: number; - scorebar?: Scorebar; - selectedPlayerId: string; - showingGrid: boolean; + interface SelectedDevicesOverlay { + graphics: GameObjects.Graphics; + scene: Scene; + showing: boolean; + hide(): void; + show(rects: Rect[]): void; } - - interface Permissions { - adding: boolean; - editing: boolean; - manageCodeGrids: boolean; - removing: boolean; + interface MultiSelect { + boundingBoxAroundEverything: Rect | null; + currentlySelectedDevices: Device[]; + currentlySelectedDevicesIds: string[]; + hidingSelectionForDevices: boolean; + isSelecting: boolean; + modifierKeyDown: boolean; + mouseShifts: Vector[]; + movedOrCopiedDevices: Device[]; + overlay: Overlay; + scene: Scene; + selectedDevices: Device[]; + selectedDevicesIds: string[]; + selectedDevicesOverlay: SelectedDevicesOverlay; + selection: Rect | null; + addDeviceToSelection(device: Device): void; + endSelectionRect(): void; + findSelectedDevices(): void; + hasSomeSelection(): boolean; + hideSelection(): void; + multiselectDeleteKeyHandler(): void; + multiselectKeyHandler(down: boolean): void; + onDeviceAdded(device: Device): void; + onDeviceRemoved(id: string): void; + setShiftParams(): void; + startSelectionRect(): void; + unselectAll(): void; + update(): void; + updateSelectedDevicesOverlay(): void; + updateSelectionRect(): void; } - - interface Widget { - type: string; + interface PlatformerEditing { + setTopDownControlsActive(active: boolean): void; + } + interface Removal { + overlay: Overlay; + prevMouseWasDown: boolean; + scene: Scene; + checkForItem(): void; + createStateListeners(): void; + removeSelectedItems(): void; + update(): void; + } + interface ActionManager { + depthSort: DepthSort; + multiSelect: MultiSelect; + platformerEditing: PlatformerEditing; + removal: Removal; + update(): void; + } + interface Spectating { + findNewCharacter(): void; + onBeginSpectating(): void; + onEndSpectating(): void; + setShuffle(shuffle: boolean, save?: boolean): void; + } + interface CharacterOptions { id: string; + x: number; y: number; - placement: string; - statName: string; - statValue: number; + scale: number; + type: string; } - - interface CallToActionItem { - id: string; - category: string; - name: string; - url: string; + interface CharacterManager { + characterContainer: GameObjects.Container; + characters: Map; + scene: Scene; + spectating: Spectating; + addCharacter(options: CharacterOptions): Character; + cullCharacters(): void; + removeCharacter(id: string): void; + update(dt: number): void; } - - interface CallToActionCategory { - id: string; - name: string; - plural: string; + interface Scene extends BaseScene { + actionManager: ActionManager; + cameraHelper: any; + characterManager: CharacterManager; + dt: number; + inputManager: InputManager; + resizeManager: any; + shadowsManager: any; + spine: any; + tileManager: TileManager; + uiManager: any; + worldManager: WorldManager; + create(): void; } - - interface GameSession { - callToAction: { - categories: CallToActionCategory[]; - items: CallToActionItem[]; - }; - countdownEnd: number; - phase: string; - resultsEnd: number; - widgets: { - widgets: Widget[]; - }; + interface SoundEffect { + path: string; + volume: number; } - - interface Session { - allowGoogleTranslate: boolean; - amIGameOwner: boolean; - canAddGameTime: boolean; - cosmosBlocked: boolean; - customTeams: { - characterToTeamMap: Map; - }; - duringTransition: boolean; - gameClockDuration: string; - gameOwnerId: string; - gameSession: GameSession; - gameTime: number; - gameTimeLastUpdateAt: number; - globalPermissions: Permissions; - loadingPhase: boolean; - mapCreatorRoleLevel: number; - mapStyle: string; - modeType: string; - ownerRole: string; - phase: string; - phaseChangedAt: number; - version: string; + interface BaseAsset { + frameHeight: number; + frameRate: number; + frameWidth: number; + imageUrl: string; + scale: number; } - - interface ZoneDropOverrides { - allowItemDrop: boolean; - allowResourceDrop: boolean; - allowWeaponDrop: boolean; + interface ImpactAsset extends BaseAsset { + frames: number[]; + hideIfNoHit?: boolean; } - - interface XPAddition { - amount: number; - reason: string; - xp: number; + interface WeaponAsset extends BaseAsset { + fireFrames: number[]; + fromCharacterCenterRadius: number; + hideFireSlash: boolean; + idleFrames: number; + originX: number; + originY: number; } - - interface XP { - additionTimeouts: Map>; - additions: XPAddition[]; - showingLevelUp: boolean; + interface ProjectileAppearance { + imageUrl: string; + rotateToTarget: boolean; + scale: number; } - - interface MeSpectating { + interface CurrentAppearance { id: string; - name: string; - shuffle: boolean; + explosionSfx: SoundEffect[]; + fireSfx: SoundEffect[]; + impact: ImpactAsset; + projectile: ProjectileAppearance; + reloadSfx: SoundEffect; + weapon: WeaponAsset; } - - interface TileToRemove { - depth: number; - id: string; + interface AimingAndLookingAround { + angleTween?: Tweens.Tween; + character: Character; + currentAngle?: number; + currentAppearance?: CurrentAppearance; + currentWeaponId?: string; + isAiming: boolean; + lastUsedAngle: number; + sprite: GameObjects.Sprite; + targetAngle?: number; + characterShouldFlipX(): boolean; + destroy(): void; + isCurrentlyAiming(): boolean; + onInventoryStateChange(): void; + playFireAnimation(): void; + setImage(appearance: CurrentAppearance): void; + setSpriteParams(skipRecalculateAlpha: boolean): void; + setTargetAngle(angle: number, instant?: boolean): void; + update(): void; + updateAnotherCharacter(): void; + updateMainCharacterMouse(): void; + updateMainCharacterTouch(): void; + } + interface NonMainCharacterState { + grounded: boolean; + } + interface CharacterAnimation { + availableAnimations: string[]; + blinkTimer: number; + bodyAnimationLocked: boolean; + bodyAnimationStartedAt: number; + character: Character; + currentBodyAnimation: string; + currentEyeAnimation: string; + lastGroundedAnimationAt: number; + nonMainCharacterState: NonMainCharacterState; + prevNonMainCharacterState: NonMainCharacterState; + skinChanged: boolean; + destroy(): void; + onAnimationComplete(options: any): void; + onSkinChanged(): void; + playAnimationOrClearTrack(animations: string[], track: number): void; + playBodyAnimation(animation: string): void; + playBodySupplementalAnimation(animation: string): void; + playEyeAnimation(animation: string): void; + playJumpSupplementalAnimation(animation: string): void; + playMovementSupplementalAnimation(animation: string): void; + setupAnimations(): void; + startBlinkAnimation(): void; + stopBlinkAnimation(): void; + update(dt: number): void; + } + interface Point { + endTime: number; + endX: number; + endY: number; + startTime: number; + startX: number; + startY: number; + teleported: boolean; + usedTeleported: boolean; + } + interface EndInfo { + end: number; + start: number; x: number; y: number; } - - interface Removing { - deviceIdToRemove?: string; - removingMode: string; - removingTilesEraserSize: number; - removingTilesLayer: number; - removingTilesMode: string; - tilesToRemove: TileToRemove[]; - wireIdToRemove?: string; - } - - interface NonDismissMessage { - description: string; - title: string; + interface Movement { + character: Character; + currentPoint: Point; + currentTime: number; + nonMainCharacterGrounded: boolean; + pointMap: Point[]; + targetIsDirty: boolean; + targetNonMainCharacterGrounded: boolean; + targetX: number; + targetY: number; + teleportCount: number; + teleported: boolean; + getCurrentEndInfo(): EndInfo; + moveToTargetPosition(): void; + onMainCharacterTeleport(): void; + postPhysicsUpdate(dt: number): void; + setNonMainCharacterTargetGrounded(grounded: boolean): void; + setTargetX(x: number): void; + setTargetY(y: number): void; + setTeleportCount(teleportCount: number): void; + update(dt: number): void; } - - interface Mood { - activeDeviceId: string; - vignetteActive: boolean; - vignetteStrength: number; + interface Updates { + update(update: { + delta: number; + }): void; + updateAlpha(): void; + updateDepth(): void; + updatePosition(dt: number): void; + updateScale(): void; } - - interface MobileControls { - left: boolean; - right: boolean; - up: boolean; + interface TeamState { + status: string; + teamId: string; } - - interface InventorySlot { - amount: number; - existsBeforeReconnect: boolean; + interface TweenAlphaOptions { + alpha: number; + type: string; + duration: number; + ease?: string; } - - interface AlertFeed { - amount: number; - itemId: string; + interface Alpha { + character: Character; + cinematicModeAlpha: number; + currentAlpha: number; + immunity: number; + phaseAlpha: number; + playerAppearanceModifierDeviceAlpha: number; + scene: Scene; + getCurrentAlpha(): number; + setAlpha(type: string, alpha: number): void; + tweenAlpha(options: TweenAlphaOptions): void; + update(): void; } - - interface InteractiveSlot { - clipSize: number; - count: number; - currentClip: number; - durability: number; - itemId: string; - waiting: boolean; - waitingEndTime: number; - waitingStartTime: number; + interface TrailEmitter { + frequency: number; + quantity: number; + blendMode: number; + speed: number; + speedVariation: number; + lifetime: number; + lifetimeVariation: number; + scale: number; + scaleVariation: number; + scaleThreshold: number; + rotationRandomAtStart: boolean; + rotationChange: number; + rotationChangeVariation: number; + rotationAllowNegativeChange: boolean; + alphaThresholdStart: number; + alphaThresholdEnd: number; + gravityY: number; + yOriginChange: number; + emitterZone: Partial; } - - interface Inventory { - activeInteractiveSlot: number; - alertFeed?: AlertFeed; - alertsFeed: AlertFeed[]; - currentWaitingEndTime: number; - infiniteAmmo: boolean; - interactiveSlotErrorMessageTimeouts: Map>; - interactiveSlotErrorMessages: Map; - interactiveSlots: Map; - interactiveSlotsOrder: number[]; - isCurrentWaitingSoundForItem: boolean; - lastShotsTimestamps: Map; - maxSlots: number; - slots: Map; + interface TrailParticles { + frameHeight: number; + frameWidth: number; + imageUrl: string; + numberOfFrames: number; } - - interface InteractiveInfo { - action: string; - allowedToInteract: boolean; - message: string; - topHeader?: string; - topHeaderColor: string; + interface TrailAppearance { + id: string; + emitter: TrailEmitter; + particles: TrailParticles; } - - interface Interactives { - deviceId: string; - info: InteractiveInfo; + interface CharacterTrail { + character: Character; + currentAppearance: TrailAppearance; + currentAppearanceId: string; + isReady: boolean; + lastSetAlpha: number; + destroy(): void; + followCharacter(): void; + setNewAppearance(appearance: TrailAppearance): void; + update(): void; + updateAppearance(id: string): void; } - - interface Health { - fragility: number; - health: number; - lives: number; - maxHealth: number; - maxShield: number; - shield: number; + interface Culling { + character: Character; + isInCamera: boolean; + needsCullUpdate: boolean; + scene: Scene; + shouldForceUpdate: boolean; + forceUpdate(): void; + hideObject(object: any): void; + onInCamera(): void; + onOutCamera(): void; + showObject(object: any): void; + updateNeedsUpdate(): void; } - - interface EditingPreferences { - cameraZoom: number; - movementSpeed: number | null; - phase: boolean | null; - showGrid: boolean | null; - topDownControlsActive: boolean; + interface Depth { + character: Character; + currentDepth: number; + lastY: number; + update(): void; + updateDepth(): void; } - - interface VisualEditing { - active: boolean; - cursor: string; - id: string; - instruction: string; - keyboardHelpers: { - trigger: string; - action: string; - }[]; + interface Dimensions { + character: Character; + currentDimensionsId: string; + bottomY: number; + centerX: number; + topY: number; + x: number; + onPotentialDimensionsChange(): void; } - - interface SortingState { + interface Flip { + character: Character; + flipXLastX: number; + isFlipped: boolean; + lastX: number; + lastY: number; + update(): void; + updateFlipForMainCharacter(): void; + updateFlipForOthers(): void; + } + interface Healthbar extends Updates { + character: Character; depth: number; - deviceId: string; - deviceName: string; - globalDepth: number; - layer: string; - y: number; + isVisible: boolean; + scene: Scene; + destroy(): void; + makeIndicator(): void; + updateValue(): void; } - - interface CurrentlyEditedDevice { - deviceOptionId: string; - id: string; + interface Immunity { + character: Character; + classImmunityActive: boolean; + spawnImmunityActive: boolean; + activate(): void; + activateClassImmunity(): void; + activateSpawnImmunity(): void; + deactivate(): void; + deactivateClassImmunity(): void; + deactivateSpawnImmunity(): void; + isActive(): boolean; } - - interface EditingDevice { - currentlyEditedDevice: CurrentlyEditedDevice; - currentlyEditedGridId: string; - currentlySortedDeviceId: string; - screen: string; - sortingState: SortingState[]; - usingMultiselect: boolean; - visualEditing: VisualEditing; + interface ImpactAnimation { + animations: Map; + character: Character; + loadedAnimations: Set; + scene: Scene; + _play(animation: string): void; + destroy(): void; + load(animation: string): void; + play(animation: string): void; } - - interface Editing { - device: EditingDevice; - preferences: EditingPreferences; - wire: { - currentlyEditedWireId: string; - }; + interface Indicator extends Updates { + character: Character; + characterHeight: number; + depth: number; + image: GameObjects.Image; + isMain: boolean; + isSpectated: boolean; + lastCharacterAlpha: number; + scene: Scene; + teamState: TeamState; + destroy(): void; + makeIndicator(): void; } - - interface MeDeviceUI { - current: { - deviceId: string; - props: Record; - }; - desiredOpenDeviceId?: string; - serverVersionOpenDeviceId: string; + interface CharacterInput { + character: Character; + isListeningForInput: boolean; + scene: Scene; + setupInput(): void; } - - interface MeCustomAssets { - currentData?: { - shapes: Shapes; - }; - currentIcon: string; - currentId: string; - currentName: string; - currentOptionId: string; - isUIOpen: boolean; - openOptionId: string | null; - pendingDeleteId: string | null; - showDeleteConfirm: boolean; + interface Nametag { + alpha: number; + character: Character; + creatingTag: boolean; + depth: number; + destroyed: boolean; + followScale: boolean; + fragilityTag?: GameObjects.Text; + healthMode: string; + name: string; + scale: number; + scene: Scene; + tag: GameObjects.Text; + teamState: TeamState; + fontColor: string; + tags: GameObjects.Text[]; + createFragilityTag(): void; + createTag(): void; + destroy(): void; + makeVisibleChanges(force?: boolean): void; + playHideAnimation(): void; + playShowUpAnimation(): void; + setName(name: string): void; + update(update: { + teamState: TeamState; + }): void; + updateFontColor(): void; + updateFragility(fragility: number): void; + updateTagAlpha(force?: boolean): void; + updateTagDepth(force?: boolean): void; + updateTagPosition(force?: boolean): void; + updateTagScale(force?: boolean): void; } - - interface Context { - cursorIsOverCharacterId: string; - __devicesUnderCursor: string[]; - __wiresUnderCursor: Set; - cursorIsOverDevice: boolean; - cursorIsOverWire: boolean; + interface Network { + lastAngle?: number; + lastAngleUpdate: number; + updateAimAngle(angle: number): void; } - - interface ClassDesigner { - activeClassDeviceId: string; - lastActivatedClassDeviceId: string; - lastClassDeviceActivationId: number; + interface CharacterPosition { + character: Character; + update(dt: number): void; } - - interface CinematicMode { - charactersVisible: boolean; - enabled: boolean; - followingMainCharacter: boolean; - hidingGUI: boolean; - mainCharacterVisible: boolean; - nameTagsVisible: boolean; + interface TweenScaleOptions { + type: string; + scale: number; + duration: number; } - - interface AddingWires { - hoveringOverSupportedDevice: boolean; - pointUnderMouseDeviceId?: string; - startDeviceSelected: boolean; + interface Scale { + activeScale: number; + baseScale: number; + character: Character; + respawningScale: number; + scaleX: number; + scaleY: number; + scene: Scene; + spectatorScale: number; + dependencyScale: number; + isVisible: boolean; + getCurrentScale(type: number): void; + onSkinChange(): void; + setScale(type: number, scale: number): void; + tweenScale(options: TweenScaleOptions): void; + update(): void; } - - interface AddingTerrain { - brushSize: number; - buildTerrainAsWall: boolean; - currentlySelectedTerrain: string; - currentlySelectedTerrainDepth: number; + interface Shadow { + character: Character; + image?: GameObjects.Image; + createShadow(): void; + destroy(): void; + update(): void; } - - interface ExistingDevice { - action: string; + interface SkinOptions { id: string; - shiftX: number; - shiftY: number; - use: boolean; + editStyles?: Record; } - - interface AddingDevices { - currentlySelectedProp: string; - existingDevice: ExistingDevice; - selectedDeviceType: string; + interface SkinSetupOptions extends SkinOptions { + x?: number; + y?: number; } - - interface Adding { - devices: AddingDevices; - terrain: AddingTerrain; - wires: AddingWires; - mode: string; + interface Skin { + character: Character; + editStyles?: Record; + latestSkinId: string; + scene: Scene; + skinId: string; + applyEditStyles(options: SkinOptions): void; + setupSkin(position: SkinSetupOptions): void; + updateSkin(options: SkinOptions): void; } - - interface Me { - adding: Adding; - cinematicMode: CinematicMode; - classDesigner: ClassDesigner; - completedInitialPlacement: boolean; - context: Context; - currentAction: string; - customAssets: MeCustomAssets; - deviceUI: MeDeviceUI; - editing: Editing; - gotKicked: boolean; - health: Health; - interactives: Interactives; - inventory: Inventory; - isRespawning: boolean; - mobileControls: MobileControls; - mood: Mood; - movementSpeed: number; - myTeam: string; - nonDismissMessage: NonDismissMessage; - phase: boolean; - preferences: { - startGameWithMode: string; - }; - properties: Map; - removing: Removing; - roleLevel: number; - spawnPosition: Vector; - spectating: MeSpectating; - teleportCount: number; - unredeemeedXP: number; - xp: XP; - zoneDropOverrides: ZoneDropOverrides; + interface TintParams { + type: string; + fromColor: string; + toColor: string; + duration: number; + tween?: Tweens.Tween; + ease(t: number): number; } - - interface QueuedTile { - timestamp: number; - removedBodyIds: string[]; + interface Tint { + character: Character; + scene: Scene; + phase?: TintParams; + playerAppearanceModifierDevice?: TintParams; + immunity?: TintParams; + damageBoost?: TintParams; + getTintParams(type: string): TintParams | undefined; + setTintParams(type: string, tint?: TintParams): void; + startAnimateTint(params: TintParams): void; + stopAnimateTint(type: string): void; + update(): void; } - - interface Tile { - collides: boolean; - depth: number; - terrain: string; - x: number; - y: number; + interface VFX { + character: Character; + damageBoostActive: boolean; + phaseActive: boolean; + tintModifierId: string; + transparencyModifierId: string; + setTintModifier(id: string): void; + setTransparencyModifier(id: string): void; + startDamageBoostAnim(): void; + startPhaseAnim(): void; + stopDamageBoostAnim(): void; + stopPhaseAnim(): void; } - - interface Terrain { - currentTerrainUpdateId: number; - modifiedHealth: Map; - queuedTiles: Map; - teamColorTiles: Map; - tiles: Map; + interface Character { + aimingAndLookingAround: AimingAndLookingAround; + alpha: Alpha; + animation: CharacterAnimation; + body: Vector; + characterTrail: CharacterTrail; + culling: Culling; + depth: Depth; + dimensions: Dimensions; + flip: Flip; + healthbar: Healthbar; + id: string; + immunity: Immunity; + impactAnimation: ImpactAnimation; + indicator: Indicator; + input: CharacterInput; + isActive: boolean; + isDestroyed: boolean; + isMain: boolean; + movement: Movement; + nametag: Nametag; + network: Network; + physics: Physics; + position: CharacterPosition; + prevBody: Vector; + scale: Scale; + scene: Scene; + shadow: Shadow; + skin: Skin; + spine: any; + teamId: string; + tint: Tint; + type: string; + vfx: VFX; + destroy(): void; + setIsMain(isMain: boolean): void; + update(dt: number): void; } - - interface DeviceState { - deviceId: string; - properties: Map; + interface ActivityFeed { + feedItems: { + id: string; + message: string; + }[]; } - - interface CodeGridItem { - createdAt: number; - existsBeforeReconnect: boolean; - json: string; - triggerType: string; - owner?: string; - triggerValue?: string; - visitors: string[]; + interface Assignment { + hasSavedProgress: boolean; + objective: string; + percentageComplete: number; } - - interface CodeGrid { - existsBeforeReconnect: boolean; - items: Map; + interface EditingStore { + accessPoints: Map; + gridSnap: number; + showMemoryBarAtAllTimes: boolean; } - - interface WireConnection { - id: string; - name: string; + interface Hooks { + hookJSON: string; } - - interface CodeGridSchema { - allowChannelGrids: boolean; - customBlocks: any[]; - triggers: any[]; + interface Loading { + completedInitialLoad: boolean; + loadedInitialDevices: boolean; + loadedInitialTerrain: boolean; + percentageAssetsLoaded: number; } - - interface DeviceOption { - codeGridSchema: CodeGridSchema; - defaultState: Record; - description?: string; - id: string; - initialMemoryCost?: number; - maxOnMap?: number; - maximumRoleLevel?: number; - minimumRoleLevel?: number; - name?: string; - optionSchema: { - options: any[]; - }; - seasonTicketRequired?: boolean; - subsequentMemoryCost?: number; - supportedMapStyles?: string[]; - wireConfig: { - in: { - connections: WireConnection[]; - }; - out: { - connections: WireConnection[]; - }; - }; + interface Matchmaker { + gameCode: string; } - - interface DeviceData { - depth: number; - deviceOption: DeviceOption; - existsBeforeReconnect: boolean; - hooks: any; - id: string; - isPreview: boolean; - layerId: string; - name: any; - options: Record; - props: any; - x: number; - y: number; + interface NetworkStore { + attemptingToConnect: boolean; + attemptingToReconnect: boolean; + authId: string; + client: any; + clientConnectionString: string; + error: any; + errorFindingServerForGame: boolean; + errorJoiningRoom: boolean; + failedToReconnect: boolean; + findingServerForGame: boolean; + hasJoinedRoom: boolean; + isOffline: boolean; + isUpToDateWithPingPong: boolean; + joinedRoom: boolean; + phaseBeforeReconnect: string | null; + ping: number; + room: any; + roomIntentErrorMessage: string; + syncingAfterReconnection: boolean; } - - interface WorldDevices { - codeGrids: Map; - devices: Map; - states: Map; + interface PhaserStore { + mainCharacter: Character; + mainCharacterTeleported: boolean; + scene: Scene; } - - interface Shapes { - circles: number[][]; - lines: number[][]; - paths: number[][]; - rects: number[][]; + interface SceneStore { + currentScene: string; + gpuTier: number; + isCursorOverCanvas: boolean; } - - interface CustomAsset { - data: { - shapes: Shapes; - }; - icon: string; + interface Team { + characters: Map; id: string; name: string; - optionId: string; + score: number; } - - interface WorldCustomAssets { - customAssets: Map; - isUIOpen: boolean; + interface Teams { + teams: Map; updateCounter: number; } - - interface World { - customAssets: WorldCustomAssets; - devices: WorldDevices; - height: number; - width: number; - mapOptionsJSON: string; - terrain: Terrain; - wires: { - wires: Map; - }; - } - + /** The stores type is incomplete and is not guaranteed to be accurate */ interface Stores { activityFeed: ActivityFeed; assignment: Assignment; @@ -2180,443 +1984,284 @@ declare global { me: Me; memorySystem: MemorySystem; network: NetworkStore; - phaser: Phaser; + phaser: PhaserStore; scene: SceneStore; session: Session; teams: Teams; - world: World; + world: GimkitWorld; worldOptions: WorldOptions; } } - type SettingsChangeCallback = (value: any, remote: boolean) => void; - - interface CustomSection { - type: "customsection"; - id: string; + interface BaseSetting { + id: K; default?: T; onChange?: (value: T, remote: boolean) => void; - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - render: (container: HTMLElement, currentValue: T, onChange: (newValue: T) => void) => (() => void) | void; - } - - interface CustomSetting extends BaseSetting { - type: "custom"; - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - render: (container: HTMLElement, currentValue: T, update: (newValue: T) => void) => (() => void) | void; - } - - interface ColorSetting extends BaseSetting { - type: "color"; - rgba?: boolean; - } - - interface RadioSetting extends BaseSetting { - type: "radio"; - options: { - label: string; - value: string; - }[]; - } - - interface SliderSetting extends BaseSetting { - type: "slider"; - min: number; - max: number; - step?: number; - ticks?: number[]; - formatter?: (value: number) => string; - } - - interface TextSetting extends BaseSetting { - type: "text"; - placeholder?: string; - maxLength?: number; } - - interface ToggleSetting extends BaseSetting { - type: "toggle"; - } - - interface NumberSetting extends BaseSetting { - type: "number"; - min?: number; - max?: number; - step?: number; - } - - interface MultiselectSetting extends BaseSetting { - type: "multiselect"; - options: { - label: string; - value: string; - }[]; - } - - interface BaseSetting { - id: string; - default?: T; + interface NamedSetting extends BaseSetting { title: string; description?: string; - onChange?: (value: T, remote: boolean) => void; } - - interface DropdownSetting extends BaseSetting { + interface DropdownSetting extends NamedSetting { type: "dropdown"; - options: { + options: ReadonlyArray<{ label: string; value: string; - }[]; + }>; allowNone?: boolean; } - - type PluginSetting = - | DropdownSetting - | MultiselectSetting - | NumberSetting - | ToggleSetting - | TextSetting - | SliderSetting - | RadioSetting - | ColorSetting - | CustomSetting - | CustomSection; - - interface SettingGroup { - type: "group"; - title: string; - settings: PluginSetting[]; - } - - type PluginSettingsDescription = (PluginSetting | SettingGroup)[]; - - interface SettingsMethods { - create: (description: PluginSettingsDescription) => void; - listen: (key: string, callback: SettingsChangeCallback, immediate?: boolean) => () => void; - } - - type PluginSettings = SettingsMethods & Record; - - class PluginsApi { - /** A list of all the plugins installed */ - get list(): string[]; - /** Whether a plugin exists and is enabled */ - isEnabled(name: string): boolean; - /** Gets the headers of a plugin, such as version, author, and description */ - getHeaders(name: string): ScriptHeaders; - /** Gets the exported values of a plugin, if it has been enabled */ - get(name: T): Gimloader.Plugins[T]; - /** - * @deprecated Use {@link get} instead - * @hidden - */ - getPlugin(name: string): { - return: any; - }; - } - - interface ScriptHeaders { - name: string; - description: string; - author: string; - version: string | null; - reloadRequired: string; - isLibrary: string; - downloadUrl: string | null; - webpage: string | null; - needsLib: string[]; - optionalLib: string[]; - deprecated: string | null; - gamemode: string[]; - changelog: string[]; - /** Only available for plugins */ - needsPlugin: string[]; - hasSettings: string; - } - - class LibsApi { - /** A list of all the libraries installed */ - get list(): string[]; - /** Gets whether or not a plugin is installed and enabled */ - isEnabled(name: string): boolean; - /** Gets the headers of a library, such as version, author, and description */ - getHeaders(name: string): ScriptHeaders; - /** Gets the exported values of a library */ - get(name: T): Gimloader.Libraries[T]; - } - - class ScopedCommandsApi { - private readonly id; - constructor(id: string); - /** Adds a command to the user's command palette. Can request additional input within the callback. */ - addCommand(options: CommandOptions, callback: CommandCallback): () => void; - } - - interface CommandStringOptions extends BaseCommandOptions { - maxLength?: number; + interface MultiselectSetting extends NamedSetting> { + type: "multiselect"; + options: ReadonlyArray<{ + label: string; + value: string; + }>; } - - interface CommandNumberOptions extends BaseCommandOptions { + interface NumberSetting extends NamedSetting { + type: "number"; min?: number; max?: number; - decimal?: boolean; + step?: number; } - - interface BaseCommandOptions { - title: string; + interface ToggleSetting extends NamedSetting { + type: "toggle"; } - - interface CommandSelectOptions extends BaseCommandOptions { - options: { + interface TextSetting extends NamedSetting { + type: "text"; + placeholder?: string; + maxLength?: number; + } + interface SliderSetting extends NamedSetting { + type: "slider"; + min: number; + max: number; + step?: number; + ticks?: ReadonlyArray; + formatter?: (value: number) => string; + } + interface RadioSetting extends NamedSetting { + type: "radio"; + options: ReadonlyArray<{ label: string; value: string; - }[]; + }>; } - - interface CommandContext { - select(options: CommandSelectOptions): Promise; - number(options: CommandNumberOptions): Promise; - string(options: CommandStringOptions): Promise; + interface ColorSetting extends NamedSetting { + type: "color"; + rgba?: boolean; + } + interface CustomSetting extends NamedSetting { + type: "custom"; + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + render: (container: HTMLElement, currentValue: T, update: (newValue: T) => void) => (() => void) | void; + } + interface CustomSection extends BaseSetting { + type: "customsection"; + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + render: (container: HTMLElement, currentValue: T, onChange: (newValue: T) => void) => (() => void) | void; + } + type PluginSetting = + | DropdownSetting + | MultiselectSetting + | NumberSetting + | ToggleSetting + | TextSetting + | SliderSetting + | RadioSetting + | ColorSetting + | CustomSetting + | CustomSection; + interface SettingGroup { + type: "group"; + title: string; + settings: ReadonlyArray; + } + type PluginSettingsDescription = ReadonlyArray; + type SettingsChangeCallback = (value: T, remote: boolean) => void; + type DescriptionToReturnType = T extends DropdownSetting ? string + : T extends MultiselectSetting ? ReadonlyArray + : T extends NumberSetting ? number + : T extends ToggleSetting ? boolean + : T extends TextSetting ? string + : T extends SliderSetting ? number + : T extends RadioSetting ? string + : T extends ColorSetting ? string + : T extends CustomSetting ? V + : T extends CustomSection ? V + : never; + type ExtractSettingObject = T extends PluginSetting ? { + [K in Id]: DescriptionToReturnType; + } + : T extends SettingGroup ? ExtractSettingObject + : never; + type UnionToIntersection = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never; + type SettingsObject = T & { + listen(key: K, callback: SettingsChangeCallback, immediate?: boolean): void; + }; + interface SettingsMethods { + create( + description: T, + ): SettingsObject>>; + listen(key: string, callback: SettingsChangeCallback, immediate?: boolean): () => void; } + type PluginSettings = SettingsMethods & Record; - type CommandCallback = (context: CommandContext) => void | Promise; + interface HotkeyTrigger { + /** Should be a keyboardevent [code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) */ + key?: string; + /** Should be keyboardevent [codes](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) */ + keys?: string[]; + ctrl?: boolean; + shift?: boolean; + alt?: boolean; + } - interface CommandOptions { - text: string | (() => string); - keywords?: string[]; - hidden?: () => boolean; + interface HotkeyOptions extends HotkeyTrigger { + preventDefault?: boolean; } - class CommandsApi { - /** Adds a command to the user's command palette. Can request additional input within the callback. */ - addCommand(id: string, options: CommandOptions, callback: CommandCallback): () => void; - /** Removes all commands that were added with the same id */ - removeCommands(id: string): void; + interface ConfigurableHotkeyOptions { + category: string; + /** There should be no duplicate titles within a category */ + title: string; + preventDefault?: boolean; + default?: HotkeyTrigger; + } + interface OldConfigurableOptions { + category: string; + title: string; + preventDefault?: boolean; + defaultKeys?: Set; } - class ScopedRewriterApi { - private readonly id; - constructor(id: string); - /** - * Creates a hook that will modify the code of a script before it is run. - * This value is cached, so this hook may not run on subsequent page loads. - * addParseHook should always be called in the top level of a script. - * @param prefix Limits the hook to only running on scripts beginning with this prefix. - * Passing `true` will only run on the index script, and passing `false` will run on all scripts. - * @param callback The function that will modify the code. Should return the modified code. Cannot have side effects. - */ - addParseHook(prefix: string | boolean, callback: (code: string) => string): () => void; + type KeyboardCallback = (e: KeyboardEvent) => void; + class BaseHotkeysApi { /** - * Creates a shared value that can be accessed from any script. - * @param id A unique identifier for the shared value. - * @param value The value to be shared. - * @returns A string representing the code to access the shared value. + * Releases all keys, needed if a hotkey opens something that will + * prevent keyup events from being registered, such as an alert */ - createShared(id: string, value: any): string; - /** Removes the shared value with a certain id created by {@link createShared} */ - removeSharedById(id: string): void; + releaseAll(): void; + /** Which key codes are currently being pressed */ + get pressed(): Set; /** - * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded. - * Returning true from the callback will remove the hook. + * @deprecated Use {@link pressed} instead + * @hidden */ - runInScope(prefix: string | boolean, callback: RunInScopeCallback): () => void; - /** A utility function that exposes a variable based on regex to get its name. */ - exposeVar(prefix: string | boolean, exposer: Exposer): () => void; - } - - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - type RunInScopeCallback = (code: string, run: (evalCode: string) => void) => true | void; - - interface Exposer { - check?: string; - find: RegExp; - callback: (val: any) => void; - multiple?: boolean; + get pressedKeys(): Set; } - - class RewriterApi { + class HotkeysApi extends BaseHotkeysApi { /** - * Creates a hook that will modify the code of a script before it is run. - * This value is cached, so this hook may not run on subsequent page loads. - * addParseHook should always be called in the top level of a script. - * @param pluginName The name of the plugin creating the hook. - * @param prefix Limits the hook to only running on scripts beginning with this prefix. - * Passing `true` will only run on the index script, and passing `false` will run on all scripts. - * @param callback A function that will modify the code, which should return the modified code. + * Adds a hotkey with a given id + * @returns A function to remove the hotkey */ - addParseHook(pluginName: string, prefix: string | boolean, modifier: (code: string) => string): () => void; - /** Removes all parse hooks created by a certain plugin */ - removeParseHooks(pluginName: string): void; + addHotkey(id: string, options: HotkeyOptions, callback: KeyboardCallback): () => void; + /** Removes all hotkeys with a given id */ + removeHotkeys(id: string): void; /** - * Creates a shared value that can be accessed from any script. - * @param pluginName The name of the plugin creating the shared value. - * @param id A unique identifier for the shared value. - * @param value The value to be shared. - * @returns A string representing the code to access the shared value. + * Adds a hotkey which can be changed by the user + * @param id A unique id for the hotkey, such as `myplugin-myhotkey` + * @returns A function to remove the hotkey */ - createShared(pluginName: string, id: string, value: any): string; - /** Removes all values created by {@link createShared} by a certain plugin */ - removeShared(pluginName: string): void; - /** Removes the shared value with a certain id created by {@link createShared} */ - removeSharedById(pluginName: string, id: string): void; + addConfigurableHotkey( + id: string, + options: ConfigurableHotkeyOptions, + callback: KeyboardCallback, + ): () => void; + /** Removes a configurable hotkey with a given id */ + removeConfigurableHotkey(id: string): void; /** - * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded. - * Returning true from the callback will remove the hook. + * @deprecated Use {@link addHotkey} instead + * @hidden */ - runInScope(pluginName: string, prefix: string | boolean, callback: RunInScopeCallback): () => void; - /** Stops all hooks created by {@link runInScope} */ - removeRunInScope(pluginName: string): void; - /** A utility function that exposes a variable based on regex to get its name. */ - exposeVar(pluginName: string, prefix: string | boolean, exposer: Exposer): () => void; - } - - class ScopedPatcherApi { - private readonly id; - constructor(id: string); + add(keys: Set, callback: KeyboardCallback, preventDefault?: boolean): void; /** - * Runs a callback after a function on an object has been run - * @returns A function to remove the patch + * @deprecated Use {@link removeHotkeys} instead + * @hidden */ - after(object: any, method: string, callback: PatcherAfterCallback): () => void; + remove(keys: Set): void; /** - * Runs a callback before a function on an object has been run. - * Return true from the callback to prevent the function from running - * @returns A function to remove the patch + * @deprecated Use {@link addConfigurableHotkey} instead + * @hidden */ - before(object: any, method: string, callback: PatcherBeforeCallback): () => void; + addConfigurable( + pluginName: string, + hotkeyId: string, + callback: KeyboardCallback, + options: OldConfigurableOptions, + ): void; /** - * Runs a function instead of a function on an object - * @returns A function to remove the patch + * @deprecated Use {@link removeConfigurableHotkeys} instead + * @hidden */ - instead(object: any, method: string, callback: PatcherInsteadCallback): () => void; + removeConfigurable(pluginName: string, hotkeyId: string): void; } - - type PatcherAfterCallback = (thisVal: any, args: IArguments, returnVal: any) => any; - - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - type PatcherBeforeCallback = (thisVal: any, args: IArguments) => boolean | void; - - type PatcherInsteadCallback = (thisVal: any, args: IArguments) => void; - - class PatcherApi { + class ScopedHotkeysApi extends BaseHotkeysApi { + constructor(id: string); /** - * Runs a callback after a function on an object has been run - * @returns A function to remove the patch + * Adds a hotkey which will fire when certain keys are pressed + * @returns A function to remove the hotkey */ - after(id: string, object: any, method: string, callback: PatcherAfterCallback): () => void; + addHotkey(options: HotkeyOptions, callback: KeyboardCallback): () => void; /** - * Runs a callback before a function on an object has been run. - * Return true from the callback to prevent the function from running - * @returns A function to remove the patch + * Adds a hotkey which can be changed by the user + * @returns A function to remove the hotkey */ - before(id: string, object: any, method: string, callback: PatcherBeforeCallback): () => void; + addConfigurableHotkey(options: ConfigurableHotkeyOptions, callback: KeyboardCallback): () => void; + } + class BaseParcelApi { /** - * Runs a function instead of a function on an object - * @returns A function to remove the patch + * Gets a module based on a filter, returns null if none are found + * Be cautious when using this- plugins will often run before any modules load in, + * meaning that if this is run on startup it will likely return nothing. + * Consider using getLazy instead. */ - instead(id: string, object: any, method: string, callback: PatcherInsteadCallback): () => void; - /** Removes all patches with a given id */ - unpatchAll(id: string): void; - } - - class ScopedStorageApi { - private readonly id; - constructor(id: string); - /** Gets a value that has previously been saved */ - getValue(key: string, defaultValue?: any): any; - /** Sets a value which can be retrieved later, persisting through reloads */ - setValue(key: string, value: any): void; - /** Removes a value which has been saved */ - deleteValue(key: string): void; - /** Adds a listener for when a stored value with a certain key changes */ - onChange(key: string, callback: ValueChangeCallback): () => void; - } - - type ValueChangeCallback = (value: any, remote: boolean) => void; - - class StorageApi { - /** Gets a value that has previously been saved */ - getValue(pluginName: string, key: string, defaultValue?: any): any; - /** Sets a value which can be retrieved later, through reloads */ - setValue(pluginName: string, key: string, value: any): void; - /** Removes a value which has been saved */ - deleteValue(pluginName: string, key: string): void; + query(): any; /** - * @deprecated use {@link deleteValue} - * @hidden + * Returns an array of all loaded modules matching a filter + * Be cautious when using this- plugins will often run before any modules load in, + * meaning that if this is run on startup it will likely return nothing. + * Consider using getLazy instead. */ - get removeValue(): (pluginName: string, key: string) => void; - /** Adds a listener for when a plugin's stored value with a certain key changes */ - onChange(pluginName: string, key: string, callback: ValueChangeCallback): () => void; - /** Removes a listener added by onChange */ - offChange(pluginName: string, key: string, callback: ValueChangeCallback): void; - /** Removes all listeners added by onChange for a certain plugin */ - offAllChanges(pluginName: string): void; + queryAll(): any[]; } - - class ScopedUIApi extends BaseUIApi { - private readonly id; - constructor(id: string); + class ParcelApi extends BaseParcelApi { /** - * Adds a style to the DOM - * @returns A function to remove the styles + * Waits for a module to be loaded, then runs a callback + * @returns A function to cancel waiting for the module */ - addStyles(style: string): () => void; - } - - interface ModalButton { - text: string; - style?: "primary" | "danger" | "close"; - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - onClick?: (event: MouseEvent) => boolean | void; - } - - interface ModalOptions { - id?: string; - title?: string; - style?: string; - className?: string; - closeOnBackgroundClick?: boolean; - buttons?: ModalButton[]; - onClosed?: () => void; - } - - class BaseUIApi { - /** Shows a customizable modal to the user */ - showModal(element: HTMLElement | import("react").ReactElement, options?: ModalOptions): void; - } - - class UIApi extends BaseUIApi { + getLazy(): () => void; + /** Cancels any calls to getLazy with the same id */ + stopLazy(): void; /** - * Adds a style to the DOM - * @returns A function to remove the styles + * @deprecated Use {@link getLazy} instead + * @hidden */ - addStyles(id: string, style: string): () => void; - /** Remove all styles with a given id */ - removeStyles(id: string): void; + get interceptRequire(): () => () => void; + /** + * @deprecated Use {@link stopLazy} instead + * @hidden + */ + get stopIntercepts(): () => void; } - - interface ScopedNetApi extends BaseNetApi { - new(id: string, defaultGamemode: string[]): this; + class ScopedParcelApi extends BaseParcelApi { /** - * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded. - * If the \@gamemode header is set the callback will only fire if the gamemode matches one of the provided gamemodes. - * @returns A function to cancel waiting for load + * Waits for a module to be loaded, then runs a callback + * @returns A function to cancel waiting for the module */ - onLoad( - callback: (type: ConnectionType, gamemode: string) => void, - gamemode?: string | string[], - ): () => void; - /** Runs a callback when a request is made that matches a certain path (can have wildcards) */ - modifyFetchRequest(path: string, callback: (options: RequesterOptions) => any): () => void; - /** Runs a callback when a response is recieved for a request under a certain path (can have wildcards) */ - modifyFetchResponse(path: string, callback: (response: any) => any): () => void; + getLazy(): () => void; } - type ConnectionType = "None" | "Colyseus" | "Blueboat"; - - interface BaseNetApi extends EventEmitter2 { - new(): this; + interface RequesterOptions { + url: string; + method?: string; + data?: any; + cacheKey?: string; + success?: (response: any, cached: boolean) => void; + both?: () => void; + error?: (error: any) => void; + } + class BaseNetApi extends EventEmitter2 { + constructor(); /** Which type of server the client is currently connected to */ get type(): ConnectionType; /** The id of the gamemode the player is currently playing */ @@ -2628,19 +2273,8 @@ declare global { /** Sends a message to the server on a specific channel */ send(channel: string, message?: any): void; } - - interface RequesterOptions { - url: string; - method?: string; - data?: any; - cacheKey?: string; - success?: (response: any, cached: boolean) => void; - both?: () => void; - error?: (error: any) => void; - } - - interface NetApi extends BaseNetApi { - new(): this; + class NetApi extends BaseNetApi { + constructor(); /** * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded * @returns A function to cancel waiting for load @@ -2670,7 +2304,8 @@ declare global { * @hidden */ get blueboat(): this; - + /** @hidden */ + private wrappedListeners; /** * @deprecated use net.on * @hidden @@ -2682,160 +2317,636 @@ declare global { */ removeEventListener(channel: string, callback: (...args: any[]) => void): void; } + class ScopedNetApi extends BaseNetApi { + constructor(id: string, defaultGamemode: string[]); + /** + * Runs a callback when the game is loaded, or runs it immediately if the game has already loaded. + * If the \@gamemode header is set the callback will only fire if the gamemode matches one of the provided gamemodes. + * @returns A function to cancel waiting for load + */ + onLoad( + callback: (type: ConnectionType, gamemode: string) => void, + gamemode?: string | string[], + ): () => void; + /** Runs a callback when a request is made that matches a certain path (can have wildcards) */ + modifyFetchRequest(path: string, callback: (options: RequesterOptions) => any): () => void; + /** Runs a callback when a response is recieved for a request under a certain path (can have wildcards) */ + modifyFetchResponse(path: string, callback: (response: any) => any): () => void; + } + interface ModalButton { + text: string; + style?: "primary" | "danger" | "close"; + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + onClick?: (event: MouseEvent) => boolean | void; + } - class ScopedParcelApi extends BaseParcelApi { + interface ModalOptions { + id?: string; + title?: string; + style?: string; + className?: string; + closeOnBackgroundClick?: boolean; + buttons?: ModalButton[]; + onClosed?: () => void; + } + type NoticeType = "info" | "success" | "error" | "warning" | "loading"; + interface MessageSemanticClassNames { + root?: string; + icon?: string; + content?: string; + } + interface MessageSemanticStyles { + root?: React$1.CSSProperties; + icon?: React$1.CSSProperties; + content?: React$1.CSSProperties; + } + type ArgsClassNamesType = MessageSemanticClassNames; + type ArgsStylesType = MessageSemanticStyles; + interface MessageConfigOptions { + top?: string | number; + duration?: number; + prefixCls?: string; + getContainer?: () => HTMLElement; + transitionName?: string; + maxCount?: number; + rtl?: boolean; + pauseOnHover?: boolean; + classNames?: ArgsClassNamesType; + styles?: ArgsStylesType; + } + interface MessageArgsProps { + content: React$1.ReactNode; + duration?: number; + type?: NoticeType; + onClose?: () => void; + icon?: React$1.ReactNode; + key?: string | number; + style?: React$1.CSSProperties; + className?: string; + classNames?: ArgsClassNamesType; + styles?: ArgsStylesType; + onClick?: (e: React$1.MouseEvent) => void; + pauseOnHover?: boolean; + } + type MessageJointContent = React$1.ReactNode | MessageArgsProps; + interface MessageType extends PromiseLike { + (): void; + } + type MessageTypeOpen = ( + content: MessageJointContent, + duration?: number | VoidFunction, + onClose?: VoidFunction, + ) => MessageType; + interface MessageInstance { + info: MessageTypeOpen; + success: MessageTypeOpen; + error: MessageTypeOpen; + warning: MessageTypeOpen; + loading: MessageTypeOpen; + open: (args: MessageArgsProps) => MessageType; + destroy: (key?: React$1.Key) => void; + } + interface MessageBaseMethods { + open: (config: MessageArgsProps) => MessageType; + destroy: (key?: React$1.Key) => void; + config: (config: MessageConfigOptions) => void; + useMessage: () => MessageInstance; + _InternalPanelDoNotUseOrYouWillBeFired: React$1.FC; + } + interface MessageMethods { + info: MessageTypeOpen; + success: MessageTypeOpen; + error: MessageTypeOpen; + warning: MessageTypeOpen; + loading: MessageTypeOpen; + } + const NotificationPlacements: readonly [ + "top", + "topLeft", + "topRight", + "bottom", + "bottomLeft", + "bottomRight", + ]; + type NotificationPlacement = (typeof NotificationPlacements)[number]; + type NotificationIconType = "success" | "info" | "error" | "warning"; + interface NotificationSemanticClassNames { + root?: string; + title?: string; + description?: string; + actions?: string; + icon?: string; + } + interface NotificationSemanticStyles { + root?: React$1.CSSProperties; + title?: React$1.CSSProperties; + description?: React$1.CSSProperties; + actions?: React$1.CSSProperties; + icon?: React$1.CSSProperties; + } + type NotificationClassNamesType = NotificationSemanticClassNames; + type NotificationStylesType = NotificationSemanticStyles; + interface NotificationDivProps extends React$1.HTMLProps { + "data-testid"?: string; + } + interface NotificationArgsProps { + message?: React$1.ReactNode; + title?: React$1.ReactNode; + description?: React$1.ReactNode; + btn?: React$1.ReactNode; + actions?: React$1.ReactNode; + key?: React$1.Key; + onClose?: () => void; + duration?: number | false; + showProgress?: boolean; + pauseOnHover?: boolean; + icon?: React$1.ReactNode; + placement?: NotificationPlacement; + style?: React$1.CSSProperties; + className?: string; + classNames?: NotificationClassNamesType; + styles?: NotificationStylesType; + readonly type?: NotificationIconType; + onClick?: () => void; + closeIcon?: React$1.ReactNode; + closable?: boolean | { + onClose?: () => void; + }; + props?: NotificationDivProps; + role?: "alert" | "status"; + } + type NotificationStaticFn = (args: NotificationArgsProps) => void; + interface NotificationInstance { + success: NotificationStaticFn; + error: NotificationStaticFn; + info: NotificationStaticFn; + warning: NotificationStaticFn; + open: NotificationStaticFn; + destroy: (key?: React$1.Key) => void; + } + interface NotificationGlobalConfigProps { + top?: number; + bottom?: number; + duration?: number | false; + showProgress?: boolean; + pauseOnHover?: boolean; + prefixCls?: string; + getContainer?: () => HTMLElement | ShadowRoot; + placement?: NotificationPlacement; + closeIcon?: React$1.ReactNode; + closable?: boolean | { + onClose?: () => void; + }; + rtl?: boolean; + maxCount?: number; + props?: NotificationDivProps; + } + interface NotificationBaseMethods { + open: (config: NotificationArgsProps) => void; + destroy: (key?: React$1.Key) => void; + config: (config: NotificationGlobalConfigProps) => void; + useNotification: () => NotificationInstance; + _InternalPanelDoNotUseOrYouWillBeFired: React$1.FC; + } + interface NotificationNoticeMethods { + success: NotificationStaticFn; + info: NotificationStaticFn; + warning: NotificationStaticFn; + error: NotificationStaticFn; + } + interface ModalSemanticClassNames { + root?: string; + header?: string; + body?: string; + footer?: string; + container?: string; + title?: string; + wrapper?: string; + mask?: string; + } + interface ModalSemanticStyles { + root?: React$1.CSSProperties; + header?: React$1.CSSProperties; + body?: React$1.CSSProperties; + footer?: React$1.CSSProperties; + container?: React$1.CSSProperties; + title?: React$1.CSSProperties; + wrapper?: React$1.CSSProperties; + mask?: React$1.CSSProperties; + } + type ModalClassNamesType = ModalSemanticClassNames; + type ModalStylesType = ModalSemanticStyles; + type ModalMousePosition = { + x: number; + y: number; + } | null; + type ModalGetContainerFunc = () => HTMLElement; + type ModalLegacyButtonType = "primary" | "dashed" | "default" | "text" | "link"; + interface ModalCommonProps { + footer?: + | React$1.ReactNode + | ((originNode: React$1.ReactNode, extra: { + OkBtn: React$1.FC; + CancelBtn: React$1.FC; + }) => React$1.ReactNode); + closable?: boolean | { + onClose?: () => void; + afterClose?: () => void; + }; + classNames?: ModalClassNamesType; + styles?: ModalStylesType; + } + interface ModalProps extends ModalCommonProps { + open?: boolean; + confirmLoading?: boolean; + title?: React$1.ReactNode; + onOk?: (e: React$1.MouseEvent) => void; + onCancel?: (e: React$1.MouseEvent) => void; + afterClose?: () => void; + afterOpenChange?: (open: boolean) => void; + centered?: boolean; + width?: string | number; + okText?: React$1.ReactNode; + okType?: ModalLegacyButtonType; + cancelText?: React$1.ReactNode; + maskClosable?: boolean; + forceRender?: boolean; + okButtonProps?: Record; + cancelButtonProps?: Record; + destroyOnClose?: boolean; + destroyOnHidden?: boolean; + style?: React$1.CSSProperties; + wrapClassName?: string; + maskTransitionName?: string; + transitionName?: string; + className?: string; + rootClassName?: string; + rootStyle?: React$1.CSSProperties; + getContainer?: string | HTMLElement | ModalGetContainerFunc | false; + zIndex?: number; + bodyStyle?: React$1.CSSProperties; + maskStyle?: React$1.CSSProperties; + mask?: boolean | "static"; + keyboard?: boolean; + wrapProps?: any; + prefixCls?: string; + closeIcon?: React$1.ReactNode; + modalRender?: (node: React$1.ReactNode) => React$1.ReactNode; + children?: React$1.ReactNode; + mousePosition?: ModalMousePosition; + loading?: boolean; + focusTriggerAfterClose?: boolean; + focusable?: { + focusTriggerAfterClose?: boolean; + }; + } + interface ModalFuncProps extends ModalCommonProps { + prefixCls?: string; + className?: string; + rootClassName?: string; + open?: boolean; + title?: React$1.ReactNode; + content?: React$1.ReactNode; + onOk?: (...args: any[]) => any; + onCancel?: (...args: any[]) => any; + afterClose?: () => void; + okButtonProps?: Record; + cancelButtonProps?: Record; + centered?: boolean; + width?: string | number; + okText?: React$1.ReactNode; + okType?: ModalLegacyButtonType; + cancelText?: React$1.ReactNode; + icon?: React$1.ReactNode; + mask?: boolean | "static"; + maskClosable?: boolean; + zIndex?: number; + okCancel?: boolean; + style?: React$1.CSSProperties; + wrapClassName?: string; + maskStyle?: React$1.CSSProperties; + type?: "info" | "success" | "error" | "warn" | "warning" | "confirm"; + keyboard?: boolean; + getContainer?: string | HTMLElement | ModalGetContainerFunc | false; + transitionName?: string; + maskTransitionName?: string; + direction?: "ltr" | "rtl"; + bodyStyle?: React$1.CSSProperties; + closeIcon?: React$1.ReactNode; + footer?: ModalProps["footer"]; + modalRender?: (node: React$1.ReactNode) => React$1.ReactNode; + focusTriggerAfterClose?: boolean; + autoFocusButton?: null | "ok" | "cancel"; + focusable?: { + focusTriggerAfterClose?: boolean; + autoFocusButton?: null | "ok" | "cancel"; + }; + } + type ModalConfigUpdate = ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps); + interface ModalFuncReturn { + destroy: () => void; + update: (configUpdate: ModalConfigUpdate) => void; + } + type ModalFunc = (props: ModalFuncProps) => ModalFuncReturn; + interface ModalStaticFunctions { + info: ModalFunc; + success: ModalFunc; + error: ModalFunc; + warning: ModalFunc; + confirm: ModalFunc; + warn: ModalFunc; + } + interface ModalBaseMethods { + useModal: () => [ + api: any, + contextHolder: React$1.ReactNode, + ]; + destroyAll: () => void; + config: (config: { + rootPrefixCls: string; + }) => void; + _InternalPanelDoNotUseOrYouWillBeFired: React$1.FC; + } + type AntdNotification = NotificationNoticeMethods & NotificationBaseMethods; + type AntdMessage = MessageMethods & MessageBaseMethods; + type AntdModal = React$1.FC & ModalStaticFunctions & ModalBaseMethods; + class BaseUIApi { + /** Shows a customizable modal to the user */ + showModal(element: HTMLElement | React$1.ReactElement, options?: ModalOptions): void; /** - * Waits for a module to be loaded, then runs a callback - * @returns A function to cancel waiting for the module + * Gimkit's notification object, only available when joining or playing a game + * + * {@link https://ant.design/components/notification#api} */ - getLazy(): () => void; + get notification(): AntdNotification; + /** + * Gimkit's message object + * + * {@link https://ant.design/components/message#api} + */ + get message(): AntdMessage; + /** + * Gimkit's modal object + * + * {@link https://ant.design/components/modal#modalmethod} + */ + get modal(): AntdModal; + } + class UIApi extends BaseUIApi { + /** + * Adds a style to the DOM + * @returns A function to remove the styles + */ + addStyles(id: string, style: string): () => void; + /** Remove all styles with a given id */ + removeStyles(id: string): void; + } + class ScopedUIApi extends BaseUIApi { + constructor(id: string); + /** + * Adds a style to the DOM + * @returns A function to remove the styles + */ + addStyles(style: string): () => void; } - class BaseParcelApi { + type ValueChangeCallback = (value: any, remote: boolean) => void; + class StorageApi { + /** Gets a value that has previously been saved */ + getValue(pluginName: string, key: string, defaultValue?: any): any; + /** Sets a value which can be retrieved later, through reloads */ + setValue(pluginName: string, key: string, value: any): void; + /** Removes a value which has been saved */ + deleteValue(pluginName: string, key: string): void; + /** + * @deprecated use {@link deleteValue} + * @hidden + */ + get removeValue(): (pluginName: string, key: string) => void; + /** Adds a listener for when a plugin's stored value with a certain key changes */ + onChange(pluginName: string, key: string, callback: ValueChangeCallback): () => void; + /** Removes a listener added by onChange */ + offChange(pluginName: string, key: string, callback: ValueChangeCallback): void; + /** Removes all listeners added by onChange for a certain plugin */ + offAllChanges(pluginName: string): void; + } + class ScopedStorageApi { + constructor(id: string); + /** Gets a value that has previously been saved */ + getValue(key: string, defaultValue?: any): any; + /** Sets a value which can be retrieved later, persisting through reloads */ + setValue(key: string, value: any): void; + /** Removes a value which has been saved */ + deleteValue(key: string): void; + /** Adds a listener for when a stored value with a certain key changes */ + onChange(key: string, callback: ValueChangeCallback): () => void; + } + + type PatcherAfterCallback = (thisVal: any, args: IArguments, returnVal: any) => any; + + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + type PatcherBeforeCallback = (thisVal: any, args: IArguments) => boolean | void; + + type PatcherInsteadCallback = (thisVal: any, args: IArguments) => void; + class PatcherApi { + /** + * Runs a callback after a function on an object has been run + * @returns A function to remove the patch + */ + after(id: string, object: any, method: string, callback: PatcherAfterCallback): () => void; + /** + * Runs a callback before a function on an object has been run. + * Return true from the callback to prevent the function from running + * @returns A function to remove the patch + */ + before(id: string, object: any, method: string, callback: PatcherBeforeCallback): () => void; + /** + * Runs a function instead of a function on an object + * @returns A function to remove the patch + */ + instead(id: string, object: any, method: string, callback: PatcherInsteadCallback): () => void; + /** Removes all patches with a given id */ + unpatchAll(id: string): void; + } + class ScopedPatcherApi { + constructor(id: string); + /** + * Runs a callback after a function on an object has been run + * @returns A function to remove the patch + */ + after(object: any, method: string, callback: PatcherAfterCallback): () => void; /** - * Gets a module based on a filter, returns null if none are found - * Be cautious when using this- plugins will often run before any modules load in, - * meaning that if this is run on startup it will likely return nothing. - * Consider using getLazy instead. + * Runs a callback before a function on an object has been run. + * Return true from the callback to prevent the function from running + * @returns A function to remove the patch */ - query(): any; + before(object: any, method: string, callback: PatcherBeforeCallback): () => void; /** - * Returns an array of all loaded modules matching a filter - * Be cautious when using this- plugins will often run before any modules load in, - * meaning that if this is run on startup it will likely return nothing. - * Consider using getLazy instead. + * Runs a function instead of a function on an object + * @returns A function to remove the patch */ - queryAll(): any[]; + instead(object: any, method: string, callback: PatcherInsteadCallback): () => void; } - class ParcelApi extends BaseParcelApi { + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + type RunInScopeCallback = (code: string, run: (evalCode: string) => void) => true | void; + + interface Exposer { + check?: string; + find: RegExp; + callback: (val: any) => void; + multiple?: boolean; + } + class RewriterApi { /** - * Waits for a module to be loaded, then runs a callback - * @returns A function to cancel waiting for the module + * Creates a hook that will modify the code of a script before it is run. + * This value is cached, so this hook may not run on subsequent page loads. + * addParseHook should always be called in the top level of a script. + * @param pluginName The name of the plugin creating the hook. + * @param prefix Limits the hook to only running on scripts beginning with this prefix. + * Passing `true` will only run on the index script, and passing `false` will run on all scripts. + * @param modifier A function that will modify the code, which should return the modified code. */ - getLazy(): () => void; - /** Cancels any calls to getLazy with the same id */ - stopLazy(): void; + addParseHook(pluginName: string, prefix: string | boolean, modifier: (code: string) => string): () => void; + /** Removes all parse hooks created by a certain plugin */ + removeParseHooks(pluginName: string): void; /** - * @deprecated Use {@link getLazy} instead - * @hidden + * Creates a shared value that can be accessed from any script. + * @param pluginName The name of the plugin creating the shared value. + * @param id A unique identifier for the shared value. + * @param value The value to be shared. + * @returns A string representing the code to access the shared value. */ - get interceptRequire(): () => () => void; + createShared(pluginName: string, id: string, value: any): string; + /** Removes all values created by {@link createShared} by a certain plugin */ + removeShared(pluginName: string): void; + /** Removes the shared value with a certain id created by {@link createShared} */ + removeSharedById(pluginName: string, id: string): void; /** - * @deprecated Use {@link stopLazy} instead - * @hidden + * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded. + * Returning true from the callback will remove the hook. */ - get stopIntercepts(): () => void; + runInScope(pluginName: string, prefix: string | boolean, callback: RunInScopeCallback): () => void; + /** Stops all hooks created by {@link runInScope} */ + removeRunInScope(pluginName: string): void; + /** A utility function that exposes a variable based on regex to get its name. */ + exposeVar(pluginName: string, prefix: string | boolean, exposer: Exposer): () => void; } - - class ScopedHotkeysApi extends BaseHotkeysApi { - private readonly id; + class ScopedRewriterApi { constructor(id: string); /** - * Adds a hotkey which will fire when certain keys are pressed - * @returns A function to remove the hotkey - */ - addHotkey(options: HotkeyOptions, callback: KeyboardCallback): () => void; - /** - * Adds a hotkey which can be changed by the user - * @returns A function to remove the hotkey + * Creates a hook that will modify the code of a script before it is run. + * This value is cached, so this hook may not run on subsequent page loads. + * addParseHook should always be called in the top level of a script. + * @param prefix Limits the hook to only running on scripts beginning with this prefix. + * Passing `true` will only run on the index script, and passing `false` will run on all scripts. + * @param modifier A function that will modify the code, which should return the modified code. */ - addConfigurableHotkey(options: ConfigurableHotkeyOptions, callback: KeyboardCallback): () => void; - } - - type KeyboardCallback = (e: KeyboardEvent) => void; - - class BaseHotkeysApi { + addParseHook(prefix: string | boolean, modifier: (code: string) => string): () => void; /** - * Releases all keys, needed if a hotkey opens something that will - * prevent keyup events from being registered, such as an alert + * Creates a shared value that can be accessed from any script. + * @param id A unique identifier for the shared value. + * @param value The value to be shared. + * @returns A string representing the code to access the shared value. */ - releaseAll(): void; - /** Which key codes are currently being pressed */ - get pressed(): Set; + createShared(id: string, value: any): string; + /** Removes the shared value with a certain id created by {@link createShared} */ + removeSharedById(id: string): void; /** - * @deprecated Use {@link pressed} instead - * @hidden + * Runs code in the scope of modules when they are loaded, or when runInScope is called with them already loaded. + * Returning true from the callback will remove the hook. */ - get pressedKeys(): Set; + runInScope(prefix: string | boolean, callback: RunInScopeCallback): () => void; + /** A utility function that exposes a variable based on regex to get its name. */ + exposeVar(prefix: string | boolean, exposer: Exposer): () => void; } - interface OldConfigurableOptions { - category: string; - title: string; - preventDefault?: boolean; - defaultKeys?: Set; + interface CommandOptions { + text: string | (() => string); + keywords?: string[]; + hidden?: () => boolean; } - - interface ConfigurableHotkeyOptions { - category: string; - /** There should be no duplicate titles within a category */ + interface BaseCommandOptions { title: string; - preventDefault?: boolean; - default?: HotkeyTrigger; } - - interface HotkeyTrigger { - /** Should be a keyboardevent [code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) */ - key?: string; - /** Should be keyboardevent [codes](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) */ - keys?: string[]; - ctrl?: boolean; - shift?: boolean; - alt?: boolean; + interface CommandSelectOptions extends BaseCommandOptions { + options: { + label: string; + value: string; + }[]; + } + interface CommandNumberOptions extends BaseCommandOptions { + min?: number; + max?: number; + decimal?: boolean; + } + interface CommandStringOptions extends BaseCommandOptions { + maxLength?: number; } - interface HotkeyOptions extends HotkeyTrigger { - preventDefault?: boolean; + interface CommandContext { + select(options: CommandSelectOptions): Promise; + number(options: CommandNumberOptions): Promise; + string(options: CommandStringOptions): Promise; } - class HotkeysApi extends BaseHotkeysApi { - /** - * Adds a hotkey with a given id - * @returns A function to remove the hotkey - */ - addHotkey(id: string, options: HotkeyOptions, callback: KeyboardCallback): () => void; - /** Removes all hotkeys with a given id */ - removeHotkeys(id: string): void; - /** - * Adds a hotkey which can be changed by the user - * @param id A unique id for the hotkey, such as `myplugin-myhotkey` - * @returns A function to remove the hotkey - */ - addConfigurableHotkey( - id: string, - options: ConfigurableHotkeyOptions, - callback: KeyboardCallback, - ): () => void; - /** Removes a configurable hotkey with a given id */ - removeConfigurableHotkey(id: string): void; - /** - * @deprecated Use {@link addHotkey} instead - * @hidden - */ - add(keys: Set, callback: KeyboardCallback, preventDefault?: boolean): void; - /** - * @deprecated Use {@link removeHotkeys} instead - * @hidden - */ - remove(keys: Set): void; - /** - * @deprecated Use {@link addConfigurableHotkey} instead - * @hidden - */ - addConfigurable( - pluginName: string, - hotkeyId: string, - callback: KeyboardCallback, - options: OldConfigurableOptions, - ): void; + type CommandCallback = (context: CommandContext) => void | Promise; + class CommandsApi { + /** Adds a command to the user's command palette. Can request additional input within the callback. */ + addCommand(id: string, options: CommandOptions, callback: CommandCallback): () => void; + /** Removes all commands that were added with the same id */ + removeCommands(id: string): void; + } + class ScopedCommandsApi { + constructor(id: string); + /** Adds a command to the user's command palette. Can request additional input within the callback. */ + addCommand(options: CommandOptions, callback: CommandCallback): () => void; + } + interface ScriptHeaders { + name: string; + description: string; + author: string; + version: string | null; + reloadRequired: string; + isLibrary: string; + downloadUrl: string | null; + webpage: string | null; + needsLib: string[]; + optionalLib: string[]; + deprecated: string | null; + gamemode: string[]; + changelog: string[]; + /** Only available for plugins */ + needsPlugin: string[]; + hasSettings: string; + } + class LibsApi { + /** A list of all the libraries installed */ + get list(): string[]; + /** Gets whether or not a plugin is installed and enabled */ + isEnabled(name: string): boolean; + /** Gets the headers of a library, such as version, author, and description */ + getHeaders(name: string): ScriptHeaders; + /** Gets the exported values of a library */ + get(name: T): Gimloader.Libraries[T]; + } + class PluginsApi { + /** A list of all the plugins installed */ + get list(): string[]; + /** Whether a plugin exists and is enabled */ + isEnabled(name: string): boolean; + /** Gets the headers of a plugin, such as version, author, and description */ + getHeaders(name: string): ScriptHeaders; + /** Gets the exported values of a plugin, if it has been enabled */ + get(name: T): Gimloader.Plugins[T]; /** - * @deprecated Use {@link removeConfigurableHotkeys} instead + * @deprecated Use {@link get} instead * @hidden */ - removeConfigurable(pluginName: string, hotkeyId: string): void; + getPlugin(name: string): { + return: any; + }; } - class Api { /** * @deprecated Gimkit has switched from Parcel to vite, rendering this api useless. @@ -2874,11 +2985,10 @@ declare global { /** A variety of Gimkit internal objects available in 2d gamemodes */ static get stores(): Stores.Stores; /** - * Gimkit's notification object, only available when joining or playing a game - * - * {@link https://ant.design/components/notification} + * @deprecated Use GL.UI.notification + * @hidden */ - static get notification(): any; + static get notification(): AntdNotification; /** * @deprecated No longer supported * @hidden @@ -2947,12 +3057,11 @@ declare global { /** A variety of gimkit internal objects available in 2d gamemodes */ get stores(): Stores.Stores; /** - * Gimkit's notification object, only available when joining or playing a game - * - * {@link https://ant.design/components/notification} + * @deprecated Use api.UI.notification + * @hidden */ - get notification(): any; - /** Run a callback when the plugin or library is disabled */ + get notification(): AntdNotification; + /** Run a callback when the script is disabled */ onStop: (callback: () => void) => void; /** * Run a callback when the plugin's settings menu button is clicked @@ -2960,6 +3069,8 @@ declare global { * This function is not available for libraries */ openSettingsMenu: (callback: () => void) => void; + /** Display a modal to the user indicating that the script requires a reload */ + requestReload: () => void; } interface Plugins { diff --git a/types/gimloader/package.json b/types/gimloader/package.json index 6c5de4a71ecf6c..af53d38049bf22 100644 --- a/types/gimloader/package.json +++ b/types/gimloader/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/gimloader", - "version": "1.10.9999", + "version": "1.11.9999", "nonNpm": "conflict", "nonNpmDescription": "Types for the Gimloader global variables", "projects": [