Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-02-27 22:19:58 -05:00
commit ae1d98c8cf
No known key found for this signature in database
6 changed files with 132 additions and 11 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({...})
@ -207,6 +207,10 @@ export const enum ReporterTestable {
FluxEvents = 1 << 4
}
export function defineDefault<T = any>(value: T) {
return value;
}
export const enum OptionType {
STRING,
NUMBER,
@ -339,7 +343,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 */