import type { Application } from '../application.ts'; import { type GeneratedStub, type PreparedStub } from '../types.ts'; /** * The Stub class processes template files using the Tempura template engine * to generate code files. Stubs are template files that contain placeholders * and logic for generating application resources like controllers, models, etc. * * Features: * - Tempura template processing with data binding * - Automatic file writing with directory creation * - Force overwrite support * - Export metadata parsing from template output * - Enhanced error reporting with stub file locations * * @example * const stub = new Stub(app, stubContent, '/path/to/controller.stub') * const result = await stub.generate({ * name: 'UserController', * to: app.httpControllersPath('user_controller.ts') * }) */ export declare class Stub { #private; /** * Creates a new Stub instance for processing template files. * * @param {Application} app - The application instance * @param {string} stubContents - The raw contents of the stub template * @param {string} stubPath - The absolute path to the stub file */ constructor(app: Application, stubContents: string, stubPath: string); /** * Replaces the rendered stub output with raw content. * When called, the provided content will be used as the final output * instead of processing the stub template. * * @param rawContent - The raw content to use instead of rendering the stub * @returns {this} Returns the Stub instance for method chaining */ replaceWith(rawContent: string): this; /** * Prepares the stub for file generation by rendering the template * and extracting all metadata, without actually writing to disk. * * @param {Record} stubData - The data to use for stub preparation */ prepare(stubData: Record): Promise; /** * Generates the final resource file by processing the stub template * and writing the result to disk, with support for force overwrite. * * @param {Record} stubData - The data to use for stub generation */ generate(stubData: Record): Promise; }