···11+<h3 align="center">
22+ <img src="./img/wordmark.png" alt="moonlight" />
33+44+<a href="https://discord.gg/FdZBTFCP6F">Discord server</a>
55+\- <a href="https://github.com/moonlight-mod/moonlight">GitHub</a>
66+\- <a href="https://moonlight-mod.github.io/">Docs</a>
77+88+ <hr />
99+</h3>
1010+1111+**moonlight** is yet another Discord client mod, focused on providing a decent user and developer experience.
1212+1313+moonlight is heavily inspired by hh3 (a private client mod) and the projects before it that it is inspired by, namely EndPwn. All core code is original or used with permission from their respective authors where not copyleft.
1414+1515+**_This is an experimental passion project._** moonlight was not created out of malicious intent nor intended to seriously compete with other mods. Anything and everything is subject to change.
1616+1717+moonlight is licensed under the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html) (`AGPL-3.0-or-later`). See [the documentation](https://moonlight-mod.github.io/) for more information.
···11+/*
22+ For tree shaking reasons, sometimes we need to require() instead of an import
33+ statement at the top of the module (like config, which runs node *and* web).
44+55+ require() doesn't seem to carry the types from @types/node, so this allows us
66+ to requireImport("fs") and still keep the types of fs.
77+88+ In the future, I'd like to automate ImportTypes, but I think the type is only
99+ cemented if import is passed a string literal.
1010+*/
1111+1212+const canRequire = ["path", "fs", "glob"] as const;
1313+type CanRequire = (typeof canRequire)[number];
1414+1515+type ImportTypes = {
1616+ path: typeof import("path");
1717+ fs: typeof import("fs");
1818+ glob: typeof import("glob");
1919+};
2020+2121+export default function requireImport<T extends CanRequire>(
2222+ type: T
2323+): Awaited<ImportTypes[T]> {
2424+ return require(type);
2525+}