typescriptification finalization

typescript
Drake 2 years ago
parent e8722c4999
commit 22eec8797f

2
dist/build.js vendored

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
"name": "demoncord-rewrite", "name": "demoncord-rewrite",
"version": "0.0.1", "version": "0.0.1",
"description": "A client mod for sinners.", "description": "A client mod for sinners.",
"main": "src/index.js", "main": "src/index.ts",
"scripts": { "scripts": {
"build": "rollup --config rollup.config.js", "build": "rollup --config rollup.config.js",
"watch": "node watchbuild" "watch": "node watchbuild"

@ -44,7 +44,7 @@ export default defineConfig({
find: "react", find: "react",
replacement: resolvePath( replacement: resolvePath(
projectRootDir, projectRootDir,
"src/shim_react.js" "src/shim_react.ts"
) )
} }
] ]

@ -1,8 +1,6 @@
import webpack from "./webpack";
import { instead } from "./patcher";
import webpack from "./webpack.js"; import { leak } from "./utils/memory";
import { instead } from "./patcher.js";
import { leak } from "./utils/memory.js";
type Sins = Record<string, (() => void) | null> type Sins = Record<string, (() => void) | null>

@ -1,7 +1,7 @@
import webpack from "../../webpack"; import webpack from "../../webpack";
import { after } from "../../patcher"; import { after } from "../../patcher";
import plugins from "./plugins.js"; import plugins from "./plugins";
import hummus from "./hummus.js"; import hummus from "./hummus";
import css from "../../css"; import css from "../../css";
import { React } from "../../common"; import { React } from "../../common";

9
src/global.d.ts vendored

@ -12,11 +12,14 @@ interface Nest<Schema> {
emit: any emit: any
} }
const demon: { type DemonGlobal = {
summon: (mod: string) => any summon: (mod: string) => any
} }
const demon: DemonGlobal
interface Window { interface Window {
demon: DemonGlobal
beelzejuice: Uint8Array[] beelzejuice: Uint8Array[]
webpackChunkdiscord_app: any webpackChunkdiscord_app: any
webpackJsonp: (thing1: [], thing2: [(mod: any, _exports: any, req: any) => void]) => any webpackJsonp: (thing1: [], thing2: [(mod: any, _exports: any, req: any) => void]) => any
@ -31,4 +34,6 @@ namespace JSX {
label: any label: any
span: any span: any
} }
} }
const _: any

@ -11,7 +11,7 @@ Object.assign(webpack, {
findByRitual findByRitual
}); });
const demon = { const demon: Record<string, any> = {
modules: { modules: {
webpack, webpack,
common common
@ -37,7 +37,7 @@ const demon = {
settings settings
}; };
function summon(mod) { function summon(mod: string) {
const mods = mod.split("/"); const mods = mod.split("/");
let res = demon; let res = demon;
mods.forEach((m) => { mods.forEach((m) => {
Loading…
Cancel
Save