import { Stub } from './stub.ts'; import { type Application } from '../application.ts'; /** * StubsManager handles reading, copying, and building stubs from various sources. * Stubs are template files used for code generation in AdonisJS applications. * * The manager can source stubs from: * - Application's local stubs directory (publishTarget) * - Custom file system paths * - Package exports with stubsRoot * * @example * const stubsManager = new StubsManager(app, '/path/to/stubs') * const stub = await stubsManager.build('controller.stub') * const files = await stubsManager.copy('models', { pkg: '@adonisjs/lucid' }) */ export declare class StubsManager { #private; /** * Creates a new StubsManager instance. * * @param {Application} app - The application instance * @param {string} publishTarget - Absolute directory path where stubs should be published */ constructor(app: Application, publishTarget: string); /** * Creates a Stub instance by locating and loading a stub file. * Searches in publishTarget first, then optional source or package locations. * * @param {string} stubName - Name of the stub file to build (e.g., 'controller.stub') * @param {Object} [options] - Optional configuration for stub source * @param {string} [options.source] - Custom file system path to search for stubs * @param {string} [options.pkg] - Package name to source stubs from * @returns {Promise} Promise that resolves to a Stub instance * @throws {RuntimeException} When stub file cannot be found in any source */ build(stubName: string, options?: { source?: string; pkg?: string; }): Promise; /** * Copies stub files from a source location to the publish target directory. * Can copy individual files or entire directories recursively. * * @param {string} stubPath - Relative path to the stub file or directory to copy * @param {Object} options - Copy configuration options * @param {boolean} [options.overwrite] - Whether to overwrite existing files * @param {string} [options.source] - Source file system path (mutually exclusive with pkg) * @param {string} [options.pkg] - Package name to copy from (mutually exclusive with source) * @returns {Promise} Promise that resolves to an array of copied file paths * @throws {Error} When source path cannot be found */ copy(stubPath: string, options: { overwrite?: boolean; } & ({ source: string; } | { pkg: string; })): Promise; }