import { MaybePromise } from '@stryke/types/base';
import { Options, EngineHooks, Context } from './types/build.js';
import { LogFn } from './types/config.js';
import { IPlugin } from './types/plugin.js';
import '@deepkit/type';
import '@storm-software/build-tools/types';
import '@storm-software/config/types';
import '@stryke/env/get-env-paths';
import '@stryke/env/types';
import '@stryke/types/configuration';
import '@stryke/types/package-json';
import '@stryke/types/tsconfig';
import 'hookable';
import 'jiti';
import 'magic-string';
import 'typescript';
import 'unimport';
import '@storm-software/config-tools/types';

/**
 * The base class for all plugins
 */
declare abstract class Plugin<TOptions extends Options = Options> implements IPlugin<TOptions> {
    /**
     * The name of the plugin
     */
    name: string;
    /**
     * The name of the plugin
     */
    installPath: string;
    /**
     * The logger function to use
     */
    log: LogFn;
    /**
     * The constructor for the plugin
     *
     * @param name - The name of the plugin
     * @param installPath - The path to install the plugin
     */
    constructor(name: string, installPath?: string);
    /**
     * Function to add hooks into the Storm Stack engine
     */
    abstract addHooks(hooks: EngineHooks<TOptions>): MaybePromise<void>;
    /**
     * Writes a file to the file system
     *
     * @param filepath - The file path to write the file
     * @param content - The content to write to the file
     * @param skipFormat - Should the plugin skip formatting the `content` string with Prettier
     */
    protected writeFile(filepath: string, content: string, skipFormat?: boolean): Promise<void>;
    /**
     * Installs a package if it is not already installed.
     *
     * @param context - The resolved Storm Stack context
     * @param packageName - The name of the package to install
     * @param dev - Whether to install the package as a dev dependency
     */
    protected install(context: Context<TOptions>, packageName: string, dev?: boolean): Promise<void>;
    /**
     * Builds the Storm Stack project
     *
     * @param context - The resolved Storm Stack context
     */
    protected build(context: Context<TOptions>): Promise<void>;
    /**
     * Run the build process for application projects
     *
     * @param _context - The resolved Storm Stack context
     */
    protected buildApp(_context: Context<TOptions>): Promise<void>;
    /**
     * Run the unbuild process for library builds
     *
     * @param context - The unbuild context
     */
    protected buildLib(context: Context<TOptions>): Promise<void>;
}

export { Plugin };
