diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-01 03:58:07 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-01 03:58:18 +0200 |
commit | 784e9ec9cb0c81d8d3671be27f27af69cd07da05 (patch) | |
tree | ae5d298caf51ba4be1781378753ddab066acc4bf | |
parent | e784ecda4f907db6a0519f6b7457cb541f29ae08 (diff) | |
download | Vencord-784e9ec9cb0c81d8d3671be27f27af69cd07da05.tar.gz Vencord-784e9ec9cb0c81d8d3671be27f27af69cd07da05.tar.bz2 Vencord-784e9ec9cb0c81d8d3671be27f27af69cd07da05.zip |
Expose QuickCss and Updater on global; consoleShortcuts plugin
-rw-r--r-- | src/Vencord.ts | 3 | ||||
-rw-r--r-- | src/plugins/consoleShortcuts.ts | 41 | ||||
-rw-r--r-- | src/utils/modal.tsx | 2 |
3 files changed, 46 insertions, 0 deletions
diff --git a/src/Vencord.ts b/src/Vencord.ts index 2798e70..adf8e7b 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -1,6 +1,9 @@ export * as Plugins from "./plugins"; export * as Webpack from "./webpack"; export * as Api from "./api"; +export * as Updater from "./utils/updater"; +export * as QuickCss from "./utils/quickCss"; + import { popNotice, showNotice } from "./api/Notices"; import { Settings } from "./api/settings"; import { startAllPlugins } from "./plugins"; diff --git a/src/plugins/consoleShortcuts.ts b/src/plugins/consoleShortcuts.ts new file mode 100644 index 0000000..4bc39c5 --- /dev/null +++ b/src/plugins/consoleShortcuts.ts @@ -0,0 +1,41 @@ +import { Devs } from "../utils/constants"; +import definePlugin from "../utils/types"; + +export default definePlugin({ + name: "ConsoleShortcuts", + description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.", + authors: [Devs.Ven], + + getShortcuts() { + return { + toClip: window.DiscordNative.clipboard.copy, + fromClip: window.DiscordNative.clipboard.read, + wp: Vencord.Webpack, + wpc: Vencord.Webpack.wreq.c, + wreq: Vencord.Webpack.wreq, + wpsearch: Vencord.Webpack.search, + wpex: Vencord.Webpack.extract, + findByProps: Vencord.Webpack.findByProps, + find: Vencord.Webpack.find, + Plugins: Vencord.Plugins, + React: Vencord.Webpack.Common.React, + Settings: Vencord.Settings, + Api: Vencord.Api, + reload: () => location.reload(), + restart: () => window.DiscordNative.app.relaunch() + }; + }, + + start() { + const shortcuts = this.getShortcuts(); + window.shortcutList = shortcuts; + for (const [key, val] of Object.entries(shortcuts)) + window[key] = val; + }, + + stop() { + delete window.shortcutList; + for (const key in this.getShortcuts()) + delete window[key]; + } +}); diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx index e5723a8..05baa8e 100644 --- a/src/utils/modal.tsx +++ b/src/utils/modal.tsx @@ -1,3 +1,5 @@ +// TODO: fix + import Components from "discord-types/components"; import { waitFor } from "../webpack"; |