import { Client } from "discord.js"; import readline from "node:readline"; import { Awaitable } from "../base/index.js"; import { Loader } from "./loader.js"; /** * @returns Get readline interface used by `setConsoleEvent` and `ConsoleManager`. * To prevent creating more than one interface in a program. */ export declare function getReadlineInterface(): readline.Interface; /** * For compatibility with other library, you can force `setConsoleEvent` * and `ConsoleManager` to use your interface. * * You **must** call this function before `setConsoleEvent` and `ConsoleManager`! */ export declare function setReadlineInterface(int: readline.Interface): void; /** * On Enter in Console * * *The full implementation* * * ```ts * export function setConsoleEvent(handler: (cmd: string) => void) { * rl.on("line", (cmd: string) => { * handler(cmd); * }); * } * ``` */ export declare function setConsoleEvent(handler: (cmd: string) => void): void; export type ConsoleFunction = (arg: string) => Awaitable; /** * Recommended Usage: Your bot should always logout properly * * ```js * const Console = new ConsoleManager(); * Console.useLogout(client).useReload(myLoader, ...); * ``` * * Now, if you type logout in console, the bot will logout properly. * * You can also use predefined `useReload` to reload the Loaders */ export declare class ConsoleManager { private commands; constructor(); private handleCommands; /** * Command is first word of the line. * * **Command Name is unique**, this function *will throw error* if duplicate * commands with same name are added. * */ addCommand(name: string, callback: ConsoleFunction): this; /** Template Command for Logging out */ useLogout(...clients: Client[]): this; /** Template Command for Reloading with Loaders */ useReload(...loaders: Array | (() => Awaitable)>): this; } //# sourceMappingURL=readline.d.ts.map