GoonCord/src/lib/index.ts

44 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-07-23 22:24:26 +08:00
import "../global.d.ts"; // eslint-disable-line import-alias/import-alias
import "../modules.d.ts"; // eslint-disable-line import-alias/import-alias
2024-03-11 09:49:31 +08:00
export * as api from "./api";
2024-07-30 00:18:01 +08:00
export * as debug from "./api/debug.js";
export * as settings from "./api/settings.js";
export * as fonts from "./fonts";
2024-07-22 00:17:17 +08:00
export * as plugins from "./plugins";
2024-07-30 00:18:01 +08:00
export * as themes from "./themes";
2024-03-11 09:49:31 +08:00
export * as ui from "./ui";
export * as utils from "./utils";
2024-05-20 16:39:51 +08:00
export * as metro from "@metro";
2024-03-11 15:04:11 +08:00
2024-07-30 21:10:24 +08:00
import * as fonts from "./fonts";
import * as plugins from "./plugins";
import * as themes from "./themes";
import { proxyLazy } from "./utils/lazy";
export const managers = proxyLazy(() => {
console.warn("bunny.managers.* is deprecated, and moved the top level (bunny.*). bunny.manager will be eventually removed soon");
return {
get fonts() { return fonts; },
get plugins() { return plugins; },
get themes() { return themes; }
};
}, { hint: "object" });
2024-07-30 00:18:01 +08:00
const _disposer = [] as Array<() => unknown>;
2024-03-11 15:04:11 +08:00
export function unload() {
for (const d of _disposer) if (typeof d === "function") d();
2024-05-20 16:39:51 +08:00
// @ts-expect-error
2024-03-11 15:04:11 +08:00
delete window.bunny;
}
/**
* For internal use only, do not use!
* @internal
*/
unload.push = (fn: typeof _disposer[number]) => {
_disposer.push(fn);
};