Skip to content

Commit

Permalink
Update Script and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-btnr committed Jan 14, 2025
1 parent 038ff39 commit 5406ca4
Show file tree
Hide file tree
Showing 5 changed files with 545 additions and 394 deletions.
8 changes: 4 additions & 4 deletions InvisibleTyping/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Patcher, UI, Utils, Webpack } from "@api";
import { Logger, Patcher, UI, Utils, Webpack } from "@api";
import manifest from "@manifest";
import Styles from "@styles";

Expand Down Expand Up @@ -57,7 +57,7 @@ export default class InvisibleTyping {

Settings.set("lastVersion", manifest.version);

UI.alert(title, items);
UI.alert(title as unknown as string, items);
}

patchTyping() {
Expand All @@ -75,10 +75,10 @@ export default class InvisibleTyping {

Patcher.after(ChannelTextArea.type, "render", (_, __, res) => {
const chatBar = Utils.findInTree(res, e => Array.isArray(e?.children) && e.children.some(c => c?.props?.className?.startsWith("attachButton")), { walkable: ["children", "props"] });
if (!chatBar) return console.error("[InvisibleTyping] Failed to find ChatBar");
if (!chatBar) return Logger.error("[InvisibleTyping] Failed to find ChatBar");

const textAreaState = Utils.findInTree(chatBar, e => e?.props?.channel, { walkable: ["children"] });
if (!textAreaState) return console.error("[InvisibleTyping] Failed to find textAreaState");
if (!textAreaState) return Logger.error("[InvisibleTyping] Failed to find textAreaState");

chatBar.children.splice(-1, 0, <InvisibleTypingButton channel={textAreaState?.props?.channel} isEmpty={!Boolean(textAreaState?.props?.editorTextContent)} />);
});
Expand Down
28 changes: 16 additions & 12 deletions modules.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
declare module "@api" {
import {
Tooltip,
AddonAPI,
BoundData,
BoundDOM,
BoundLogger,
BoundPatcher,
Components,
ContextMenu,
Data,
DOM,
Net,
BoundPatcher,
Plugin,
ReactUtils,
UI,
Utils,
Webpack
} from "betterdiscord";

export const Components: { Tooltip: Tooltip; };
export const Components: Components;
export const ContextMenu: ContextMenu;
export const Data: Data;
export const DOM: DOM;
export const Data: BoundData;
export const DOM: BoundDOM;
export const Logger: BoundLogger;
export const Net: Net;
export const Patcher: BoundPatcher;
export const Plugins: any;
export const Plugins: AddonAPI<Plugin>;
export const ReactUtils: ReactUtils;
export const Themes: any;
export const Themes: AddonAPI<Plugin>; // Has the same methods as Plugins
export const UI: UI;
export const Utils: Utils;
export const Webpack: Webpack;
Expand All @@ -39,11 +43,11 @@ declare module "@styles" {
declare module "@manifest" {
interface ChangelogItem {
title: string;
type: "added" | "fixed" | "improved";
type: "added" | "changed" | "fixed" | "improved";
items: string[];
}

interface Manifest {
export interface Manifest {
name: string;
version: string;
description: string;
Expand All @@ -59,4 +63,4 @@ declare module "@manifest" {

const manifest: Manifest;
export default manifest;
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"build": "node scripts/build.js"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-node-resolve": "^15.3.1",
"@types/betterdiscord": "github:zerthox/betterdiscord-types",
"@types/react": "^18.3.3",
"@types/react": "^18.3.18",
"@types/redux": "^3.6.0",
"cssom": "^0.5.0",
"esbuild": "^0.21.5",
"js-beautify": "^1.15.1",
"rollup": "^4.18.0",
"rollup": "^4.30.1",
"rollup-plugin-esbuild": "^6.1.1",
"sass": "^1.77.6"
"sass": "^1.83.4"
}
}
Loading

0 comments on commit 5406ca4

Please sign in to comment.