testing
This commit is contained in:
40
assets/vencord/VencordNativeStub.ts
Normal file
40
assets/vencord/VencordNativeStub.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
let webclass;
|
||||
|
||||
const promise = new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
new QWebChannel(qt.webChannelTransport, function (channel) {
|
||||
webclass = channel.objects.webclass;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function prepareWebclass() {
|
||||
if (!webclass) await promise;
|
||||
}
|
||||
|
||||
window.VencordNative = {
|
||||
getVersions: () => ({}),
|
||||
ipc: {
|
||||
send: async (event: string, ...args: any[]) => {
|
||||
await prepareWebclass();
|
||||
webclass.vencordSend(event, args);
|
||||
},
|
||||
sendSync: (event: string, ...args: any[]) => {
|
||||
if (event === "VencordGetSettings") return "{}";
|
||||
else throw new Error("Synchroneous IPC not implemented");
|
||||
},
|
||||
on(event: string, listener: () => {}) {
|
||||
// TODO quickCss
|
||||
},
|
||||
off(event: string, listener: () => {}) {
|
||||
// not used for now
|
||||
},
|
||||
invoke:
|
||||
(event: string, ...args: any[]) =>
|
||||
async () => {
|
||||
await prepareWebclass();
|
||||
return webclass.vencordSend(event, args);
|
||||
},
|
||||
},
|
||||
};
|
||||
14
assets/vencord/plugin.js
Normal file
14
assets/vencord/plugin.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import definePlugin from "../utils/types";
|
||||
|
||||
export default definePlugin({
|
||||
name: "discord-screenaudio",
|
||||
authors: [
|
||||
{
|
||||
name: "maltejur",
|
||||
id: 205966226709676032n,
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
description: "UI patches for discord-screenaudio.",
|
||||
patches: [],
|
||||
});
|
||||
36
assets/vencord/vencord.js
Normal file
36
assets/vencord/vencord.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user