ConsoleJanitor: Support allowing log levels (#3255)

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
sadan4 2025-02-27 19:32:09 -05:00 committed by GitHub
parent 8f65d3cae9
commit e88af36be9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 8 deletions

View file

@ -26,7 +26,7 @@ import { MessageDecorationFactory } from "@api/MessageDecorations";
import { MessageClickListener, MessageEditListener, MessageSendListener } from "@api/MessageEvents";
import { MessagePopoverButtonFactory } from "@api/MessagePopover";
import { FluxEvents } from "@webpack/types";
import { JSX } from "react";
import { ReactNode } from "react";
import { Promisable } from "type-fest";
// exists to export default definePlugin({...})
@ -202,6 +202,10 @@ export const enum ReporterTestable {
FluxEvents = 1 << 4
}
export function defineDefault<T = any>(value: T) {
return value;
}
export const enum OptionType {
STRING,
NUMBER,
@ -334,7 +338,8 @@ export interface IPluginOptionComponentProps {
export interface PluginSettingComponentDef {
type: OptionType.COMPONENT;
component: (props: IPluginOptionComponentProps) => JSX.Element;
component: (props: IPluginOptionComponentProps) => ReactNode | Promise<ReactNode>;
default?: any;
}
/** Maps a `PluginSettingDef` to its value type */