From c9f52081ef3dd1c3b4af9c502cf4d4038564b7e0 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 3 Aug 2026 11:44:42 -0700 Subject: [PATCH 1/2] [ioredis-mock] pin ioredis (#75344) --- types/ioredis-mock/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/ioredis-mock/package.json b/types/ioredis-mock/package.json index ec709a38e2578e..be9493314705b1 100644 --- a/types/ioredis-mock/package.json +++ b/types/ioredis-mock/package.json @@ -6,11 +6,11 @@ "https://github.com/stipsan/ioredis-mock#readme" ], "peerDependencies": { - "ioredis": ">=5" + "ioredis": "^5" }, "devDependencies": { "@types/node": "*", - "ioredis": ">=5", + "ioredis": "^5", "@types/ioredis-mock": "workspace:." }, "owners": [ From 641084af956e474436f66c12c22ce71ff72682ea Mon Sep 17 00:00:00 2001 From: staticvariablejames <69834129+staticvariablejames@users.noreply.github.com> Date: Mon, 3 Aug 2026 18:21:58 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75332=20[cooki?= =?UTF-8?q?eclicker]=20Update=20types/cookieclicker=20to=202.058.=20by=20@?= =?UTF-8?q?staticvariablejames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/cookieclicker/cookieclicker-tests.ts | 46 +++++++ types/cookieclicker/index.d.ts | 139 ++++++++++++++++++--- types/cookieclicker/package.json | 2 +- 3 files changed, 172 insertions(+), 15 deletions(-) diff --git a/types/cookieclicker/cookieclicker-tests.ts b/types/cookieclicker/cookieclicker-tests.ts index 5be8ab2d3c3884..1f90f807d719a5 100644 --- a/types/cookieclicker/cookieclicker-tests.ts +++ b/types/cookieclicker/cookieclicker-tests.ts @@ -244,3 +244,49 @@ let someChoice5: [number, number] = Game.YouCustomizer.genesById["moddedGene"].c // offsetGene cannot handle numbers except -1, 0, 1 // @ts-expect-error Game.YouCustomizer.offsetGene("acc2", 2); + +Game.cookiesPsRawHighest < Game.cookiesPsRaw; +let effect = Game.eff("goldenCookieEffDur"); +let effectWithDefault = Game.eff("goldenCookieEffDur", 1); +Game.RuinTheFun(1); +Game.isMinigameReady(Game.Objects["Bank"]); +Game.Objects["Bank"].minigame.reset(); + +// Game.ObjectsById is an array +Game.ObjectsById.length; +Game.ObjectsById[2]; +Game.ObjectsById["2"]; +for (var i in Game.ObjectsById) { + Game.ObjectsById[i].levelUp(true); +} + +// Shimmers can be popped with, and without, an explicit MouseEvent +let goldenCookie = new Game.shimmer("golden", { noWrath: true, type: "blab" }); +goldenCookie.pop(new MouseEvent("click")); +goldenCookie.pop(); + +// Loans +if (Game.isMinigameReady(Game.Objects["Bank"])) { + Game.Objects["Bank"].minigame.takeLoan(1); + Game.Objects["Bank"].minigame.takeLoan(1, true); + /* Game.takeLoan is defined once Game.isMinigameReady(Game.Objects["Bank"]), + * but TypeScript cannot express that. + * So we simply tell the compiler to trust us. + */ + Game.takeLoan!(2); + Game.takeLoan!(2, true)!; +} + +// Temple slots +if (Game.Objects["Temple"].minigame.gods["ages"].slot != -1) { + let slot = Game.Objects["Temple"].minigame.gods["ages"].slot; + // $ExpectType "0" | "1" | "2" + slot; +} + +// Buffs are iterable +for (var i in Game.buffs) {} + +// Global functions +// $ExpectType number +getBounds(l("bigCookie")!).centerx; diff --git a/types/cookieclicker/index.d.ts b/types/cookieclicker/index.d.ts index db0d046e8bc337..c31df5ca3edec4 100644 --- a/types/cookieclicker/index.d.ts +++ b/types/cookieclicker/index.d.ts @@ -1,3 +1,11 @@ +/* Global variables defined in . + */ +declare let VERSION: number; +declare let BETA: Game.PseudoBoolean; +declare let SAVESUFFIX: string; +declare let PRESETMODS: string[]; +declare let LOCAL: typeof App | boolean; + declare function AddEvent(htmlElement: HTMLElement, eventName: string, eventFunction: (e: Event) => void): void; declare function l(name: string): HTMLElement | null; declare function escapeRegExp(str: string): string; @@ -17,6 +25,16 @@ declare function romanize(num: number): string; declare function randomFloor(x: number): number; declare function shuffle(array: T[]): T[]; +/** + * Unused. Does the same thing as Element.prototype.getBounds (injected by the game). + */ +declare function getBounds(el: Element): ReturnType; + +/** + * Unused. Returns just centerx and centery from getBounds. + */ +declare function getCenter(el: Element): [number, number]; + /** * Returns a random member of an array, has a very slight chance to return `undefined` (When the seeded Math.random() is 1) * @param array The array to pick a member of @@ -226,9 +244,10 @@ interface Math { interface Element { /** - * Same as `getBoundingClientRect`, but applies `Game.scale` + * Similar to `getBoundingClientRect`, but adjusts the bounding box according to `Game.scale` + * and also includes the attributes `centerx` and `centery`. */ - getBounds(): DOMRect; + getBounds(): DOMRect & { centerx: number; centery: number }; } interface CanvasRenderingContext2D { @@ -375,6 +394,42 @@ declare function localStorageGet(key: string): Game.PseudoNull | null | string; // eslint-disable-next-line @typescript-eslint/no-invalid-void-type declare function localStorageSet(key: string, str: string): Game.PseudoNull | void; +/** + * Unused; see getJson instead. + * + * Sends an XMLHttpRequest to the specified URL. + * Once the request is answered, + * calls the callback with the request's response. + * + * @param url The queried URL. The game appends '?nocache='+Date.now() before issuing the request. + * @param callback The function called with the request's response, once available. + * @returns Whether the request was issued or not. + * Note that the request may still fail even if this function returns true. + */ +declare function ajax(url: string, callback: (arg: string) => void): boolean; + +/** + * An alias for window.location.origin+'/data/'. + */ +declare let DataDir: string; + +/** + * Sends an XMLHttpRequest to the specified URL. + * Once the request is answered, + * `JSON.parse`s the request's response, + * and calls the callback with the result. + * + * If either `JSON.parse` or `callback` throws any errors, + * they are passed on to the error handler. + * + * @param url The queried URL. The game appends '?nocache='+Date.now() before issuing the request. + * @param callback The function called with the request's response, once available. + * @param error The error handler, called on any try-catched errors. + * @returns Whether the request was issued or not. + * Note that the request may still fail even if this function returns true. + */ +declare function getJson(url: string, callback: (arg: string) => void, error?: (e: Error) => void): boolean; + declare function writeIcon(icon: Game.Icon): string; declare function tinyIcon(icon: Game.Icon, css?: string): string; @@ -523,9 +578,11 @@ declare namespace Game { export let Loader: Loader; export let T: number; + export let realT: number; export let drawT: number; export let loopT: number; export let fps: number; + export let baseFps: number; export let season: string; /** * The main div where all the game is contained @@ -552,6 +609,8 @@ declare namespace Game { export let cookies: number; export let cookiesd: number; export let cookiesPs: number; + export let cookiesPsRaw: number; + export let cookiesPsRawHighest: number; export let cookiesReset: number; export let cookieClicks: number; export let goldenClicks: number; @@ -585,6 +644,12 @@ declare namespace Game { export let volume: number; export let volumeMusic: number; export let scale: number; + export let zoom: number; + /** + * List of callbacks called by Game.resize. + * The arguments are the width and height of the global object window. + */ + export let onResizeCallbacks: Array<(w: number, h: number) => void>; export let elderWrath: number; export let elderWrathOld: number; export let elderWrathD: number; @@ -805,8 +870,8 @@ declare namespace Game { export let customGrandmaNames: string[]; export let heralds: number; - export function GrabData(): void; - export function GrabDataResponse(response: string): void; + export function UpdateHeralds(): void; + export function FetchGrandmaNames(): void; export let useLocalStorage: PseudoBoolean; export function ExportSave(): void; @@ -1016,7 +1081,7 @@ declare namespace Game { } export let effs: Effects; - export function eff(name: string, def: number): number; + export function eff(name: string, def?: number): number; export function CalculateGains(): void; @@ -1031,6 +1096,7 @@ declare namespace Game { constructor(type: N, obj?: C, noCount?: boolean); type: N; l: HTMLElement; + popped: boolean; x: number; y: number; id: number; @@ -1038,7 +1104,7 @@ declare namespace Game { noCount: boolean; init: () => void; update: () => void; - pop: (event: MouseEvent) => void; + pop: (event?: MouseEvent) => void; die: () => void; spawnLead: undefined | 1; } @@ -1189,7 +1255,7 @@ declare namespace Game { export let cssClasses: string[]; export function addClass(what: string): void; - function removeClass(what: string): void; + export function removeClass(what: string): void; export function updateClasses(): void; /** @@ -1675,6 +1741,7 @@ declare namespace Game { cursorL: HTMLDivElement; lumpRefill: HTMLDivElement; logic(): void; + reset(hard?: boolean): void; draw(): void; onResize(): void; onLevel(): void; @@ -1720,7 +1787,7 @@ declare namespace Game { /** * The current slot the spirit is in */ - slot: -1 | 0 | 1 | 2; + slot: -1 | "0" | "1" | "2"; } export interface PantheonMinigame extends Minigame { @@ -1785,6 +1852,7 @@ declare namespace Game { */ refillTooltip(): string; logic(): void; + reset(): void; draw(): void; } @@ -1919,6 +1987,7 @@ declare namespace Game { spellsCastTotal: number; magicPS: number; logic(): void; + reset(): void; draw(): void; } @@ -1994,6 +2063,10 @@ declare namespace Game { * The displayed name of the stock */ name: string; + /** + * The value this stock was previously purchased at. + */ + prev: number; /** * The amount of stocks bought of the good */ @@ -2173,17 +2246,24 @@ declare namespace Game { graphCtx: CanvasRenderingContext2D; toRedraw: 0 | 1 | 2; logic(): void; + reset(hard?: boolean): void; draw(): void; onResize(): void; } + /** + * Alias for `Game.Objects["Bank"].minigame.takeLoan`. + * Only available if the stock market minigame is loaded. + */ + export let takeLoan: undefined | ((id: number, interest?: boolean) => void); + export let Objects: Record & { Farm: MinigameObject; Temple: MinigameObject; "Wizard tower": MinigameObject; Bank: MinigameObject; }; - export let ObjectsById: Record; + export let ObjectsById: Array; export let ObjectsN: number; export let BuildingsOwned: number; interface BaselessArt { @@ -2237,6 +2317,12 @@ declare namespace Game { onRuinTheFun?(): void; draw?(): void; logic?(): void; + reset?(hard?: boolean): void; + + /** + * Executed on load (by Game.scriptLoaded) after launch() if there is no minigameSave. + */ + begin?(): void; } export interface BuildingArtPicture { @@ -2451,7 +2537,7 @@ declare namespace Game { levelTooltip(): string; - levelUp(): () => void; + levelUp(free?: boolean): () => void; /** * If the building is visually locked, is considered unlocked after CBTA is higher than the base cost */ @@ -2463,7 +2549,7 @@ declare namespace Game { minigameLoading?: boolean | undefined; - minigameSave: string; + minigameSave?: string; minigameName: string; @@ -3108,7 +3194,7 @@ declare namespace Game { } export let AllBGs: Background[]; - export let BGsByChoice: Record; + export let BGsByChoice: Array; // eslint-disable-next-line @typescript-eslint/no-invalid-void-type export function loseShimmeringVeil(context: string): void | false; @@ -3146,6 +3232,7 @@ declare namespace Game { export function GetHowManyReindeerDrops(): number; export let seasonDrops: string[]; + export let keepsakes: string[]; export function saySeasonSwitchUses(): string; @@ -3183,6 +3270,15 @@ declare namespace Game { export let AchievementsN: number; export let AchievementsOwned: number; + /** + * The interval timer (from a `setInterval` call) + * that animates the tooltip for the "Cookie Clicker" achievement. + * + * This variable is not set when the game first launches. + * The timer is cleared (and this variable is set to 0) when that tooltip is no longer shown. + */ + export let paradeAnimLoop: number | undefined; + export type AchievementPool = "normal" | "shadow" | "dungeon"; export class Achievement { @@ -3379,7 +3475,7 @@ declare namespace Game { l: HTMLDivElement; } - export let buffs: Buff[]; + export let buffs: Record; export let buffsN: number; export let buffsL: HTMLDivElement; @@ -3549,6 +3645,11 @@ declare namespace Game { * All milks, including fancy milk selection ones */ export let AllMilks: Milk[]; + + /** + * A system to make milks procedurally; unused + */ + export function MakeMilk(): void; export let mousePointer: number; export let cookieOriginX: number; export let cookieOriginY: number; @@ -3613,9 +3714,11 @@ declare namespace Game { | "create" | "check" | "cps" + | "cpsMult" | "cookiesPerClick" | "reset" - | "ticker"; + | "ticker" + | "tickerFinal"; export function registerHook( hook: "cps" | "cookiesPerClick", @@ -3627,6 +3730,13 @@ declare namespace Game { hook: Exclude, func: (() => void) | Array<() => void>, ): void; + + export function saveModData(): string; + export function loadModData(): void; + export function deleteModData(id: string): void; + export function deleteAllModData(): void; + export function CheckModData(): void; + export let brokenMods: string[]; export function launchMods(): void; export function resize(): void; @@ -3666,6 +3776,7 @@ declare namespace Game { * Unused */ export function setWubMusic(what: number): void; + export function setZoom(what: number): void; export function showLangSelection(firstLaunch?: boolean): void; /** * The treshold when the game considers itself to be too narrow diff --git a/types/cookieclicker/package.json b/types/cookieclicker/package.json index d59e28085afb24..c509a266c7457d 100644 --- a/types/cookieclicker/package.json +++ b/types/cookieclicker/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/cookieclicker", - "version": "2.52.9999", + "version": "2.58.9999", "nonNpm": true, "nonNpmDescription": "cookieclicker", "projects": [