From 102851558dc74db7f3e9ee26d29c7665887a4d14 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:21:37 -0400 Subject: [PATCH] Revert "Fix Stores?" This reverts commit f0df91e8e16dc3b1e18143845e0b3b925cddf694. --- package.json | 2 +- pnpm-lock.yaml | 2 +- src/webpack/common/types/stores.d.ts | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 21d85792..794f75cd 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@typescript-eslint/eslint-plugin": "^5.59.1", "@typescript-eslint/parser": "^5.59.1", "diff": "^5.1.0", - "discord-types": "^1.3.3", + "discord-types": "^1.3.26", "esbuild": "^0.15.18", "eslint": "^8.46.0", "eslint-import-resolver-alias": "^1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d04ab9a7..2e56b5dc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,7 +90,7 @@ importers: specifier: ^5.1.0 version: 5.1.0 discord-types: - specifier: ^1.3.3 + specifier: ^1.3.26 version: 1.3.26 esbuild: specifier: ^0.15.18 diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index 225c449b..037b2d81 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -21,21 +21,23 @@ import { Channel, Guild, Role } from "discord-types/general"; import { FluxDispatcher, FluxEvents } from "./utils"; +type GenericFunction = (...args: any[]) => any; + export class FluxStore { constructor(dispatcher: FluxDispatcher, eventHandlers?: Partial void>>); - addChangeListener(listener: () => void): void; - addConditionalChangeListener(removeListener: () => boolean, t?: boolean): void; + addChangeListener(callback: () => void): void; + addReactChangeListener(callback: () => void): void; + removeChangeListener(callback: () => void): void; + removeReactChangeListener(callback: () => void): void; emitChange(): void; getDispatchToken(): string; getName(): string; - hasChangeCallbacks(): boolean; initialize(): void; initializeIfNeeded(): void; - mustEmitChanges(conditional?: (t?: unknown) => boolean): void; - removeChangeListener(listener: () => void): void; - syncWith(stores: FluxStore[], emitChange: boolean, delay?: number): void; - waitFor(...stores: FluxStore[]): void; + registerActionHandlers: GenericFunction; + syncWith: GenericFunction; + waitFor: GenericFunction; __getLocalVars(): Record; static getAll(): FluxStore[];