UNPKG

meocord

Version:

MeoCord is a lightweight and modular framework for building scalable Discord bots using TypeScript and Discord.js. It simplifies bot development with an extensible architecture, TypeScript-first approach, and powerful CLI tools.

68 lines (67 loc) 3.59 kB
/** * MeoCord Framework * Copyright (C) 2025 Ukasyah Rahmatullah Zada * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ import { ControllerType } from '../../enum/controller.enum.js'; export declare class ControllerGeneratorHelper { /** * Generates a new controller file and an associated structure based on the provided arguments and controller type. * @param args - The arguments for generating the controller, including the optional controller name. * @param type - The type of the controller to generate, defined in the `ControllerType` enum. * @throws Will throw an error if the controller name is invalid or if the controller type is unsupported. */ generateController(args: { controllerName: string | undefined; }, type: ControllerType): void; /** * Builds the controller template content by populating a template with variables. * @param className - The name of the controller class. * @param type - The type of the controller, defined in the `ControllerType` enum. * @returns The populated template string for the controller. * @throws Will throw an error if the controller type is unsupported. */ buildControllerTemplate(className: string, type: ControllerType): string; /** * Retrieves the template configuration for a specific controller type and class name. * @param type - The type of the controller, defined in the `ControllerType` enum. * @param className - The name of the controller class. * @returns An object containing the template path and variables, or `undefined` if not found. */ private getTemplateConfig; /** * Generates the controller file and its associated structure (e.g., builder files, directories). * @param controllerDir - The absolute path to the controller directory. * @param kebabCaseName - The kebab-case name of the controller file. * @param className - The name of the controller class. * @param type - The type of the controller, defined in the `ControllerType` enum. * @param controllerTemplate - The populated template string for the controller file. */ private generateControllerStructure; /** * Generates a builder file for the specified controller type and stores it in the controller directory. * @param className - The name of the controller class. * @param type - The type of the controller, defined in the `ControllerType` enum. * @param controllerDir - The absolute path to the controller directory. */ private generateBuilderFile; /** * Retrieves the configuration for generating a builder file based on the controller type and class name. * @param type - The type of the controller, defined in the `ControllerType` enum. * @param className - The name of the controller class. * @returns An object containing the builder template path and variables, or `undefined` if not found. */ private getBuilderConfig; }