feat: Experimental browser support

This commit is contained in:
Vendicated 2022-10-04 00:52:42 +02:00
parent a9eae106c7
commit cc25753314
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
14 changed files with 212 additions and 41 deletions

1
src/utils/isWeb.ts Normal file
View file

@ -0,0 +1 @@
export const IS_WEB = window.IS_WEB = typeof window.DiscordNative === "undefined";

View file

@ -33,6 +33,10 @@ interface PluginDef {
patches?: Omit<Patch, "plugin">[];
dependencies?: string[],
required?: boolean;
/**
* Set this if your plugin only works on Browser or Desktop, not both
*/
target?: "WEB" | "DESKTOP" | "BOTH";
}
export type IpcRes<V = any> = { ok: true; value: V; } | { ok: false, error: any; };