Expose QuickCss and Updater on global; consoleShortcuts plugin
This commit is contained in:
parent
e784ecda4f
commit
784e9ec9cb
@ -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";
|
||||
|
41
src/plugins/consoleShortcuts.ts
Normal file
41
src/plugins/consoleShortcuts.ts
Normal file
@ -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];
|
||||
}
|
||||
});
|
@ -1,3 +1,5 @@
|
||||
// TODO: fix
|
||||
|
||||
import Components from "discord-types/components";
|
||||
import { waitFor } from "../webpack";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user