feat: auto-managed flux subscriptions via plugin.flux (#959)

This commit is contained in:
V 2023-04-22 03:18:19 +02:00 committed by GitHub
parent c6f0c84935
commit 63fc354d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 210 additions and 253 deletions

View file

@ -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<string, any>;
}>;
/**
* Allows you to subscribe to Flux events
*/
flux?: {
[E in FluxEvents]?: (event: any) => void;
};
}
export enum OptionType {