From f0df91e8e16dc3b1e18143845e0b3b925cddf694 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:15:09 -0400 Subject: [PATCH] Fix Stores? --- package.json | 2 +- pnpm-lock.yaml | 2 +- src/webpack/common/types/stores.d.ts | 16 +++++++--------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 794f75cd..21d85792 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.26", + "discord-types": "^1.3.3", "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 2e56b5dc..d04ab9a7 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.26 + specifier: ^1.3.3 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 037b2d81..225c449b 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -21,23 +21,21 @@ 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(callback: () => void): void; - addReactChangeListener(callback: () => void): void; - removeChangeListener(callback: () => void): void; - removeReactChangeListener(callback: () => void): void; + addChangeListener(listener: () => void): void; + addConditionalChangeListener(removeListener: () => boolean, t?: boolean): void; emitChange(): void; getDispatchToken(): string; getName(): string; + hasChangeCallbacks(): boolean; initialize(): void; initializeIfNeeded(): void; - registerActionHandlers: GenericFunction; - syncWith: GenericFunction; - waitFor: GenericFunction; + mustEmitChanges(conditional?: (t?: unknown) => boolean): void; + removeChangeListener(listener: () => void): void; + syncWith(stores: FluxStore[], emitChange: boolean, delay?: number): void; + waitFor(...stores: FluxStore[]): void; __getLocalVars(): Record; static getAll(): FluxStore[];