From cc257533148419b1c94a1cd257e756d2688a403c Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 4 Oct 2022 00:52:42 +0200 Subject: feat: Experimental browser support --- src/utils/isWeb.ts | 1 + src/utils/types.ts | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 src/utils/isWeb.ts (limited to 'src/utils') diff --git a/src/utils/isWeb.ts b/src/utils/isWeb.ts new file mode 100644 index 0000000..4082164 --- /dev/null +++ b/src/utils/isWeb.ts @@ -0,0 +1 @@ +export const IS_WEB = window.IS_WEB = typeof window.DiscordNative === "undefined"; diff --git a/src/utils/types.ts b/src/utils/types.ts index a6b79c5..1c63613 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -33,6 +33,10 @@ interface PluginDef { patches?: Omit[]; dependencies?: string[], required?: boolean; + /** + * Set this if your plugin only works on Browser or Desktop, not both + */ + target?: "WEB" | "DESKTOP" | "BOTH"; } export type IpcRes = { ok: true; value: V; } | { ok: false, error: any; }; -- cgit