From 63fc354d483b86857bbee7f540c66ba614fc0f1f Mon Sep 17 00:00:00 2001 From: V Date: Sat, 22 Apr 2023 03:18:19 +0200 Subject: feat: auto-managed flux subscriptions via plugin.flux (#959) --- src/utils/types.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/utils') diff --git a/src/utils/types.ts b/src/utils/types.ts index 54c9674..d2b5e0e 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -17,6 +17,7 @@ */ import { Command } from "@api/Commands"; +import { FluxEvents } from "@webpack/types"; import { Promisable } from "type-fest"; // exists to export default definePlugin({...}) @@ -101,6 +102,12 @@ export interface PluginDef { settingsAboutComponent?: React.ComponentType<{ tempSettings?: Record; }>; + /** + * Allows you to subscribe to Flux events + */ + flux?: { + [E in FluxEvents]?: (event: any) => void; + }; } export enum OptionType { -- cgit