import { mock } from 'node:test';
import type { BaseEnvironment, BaseEnvironmentOptions, BaseGenerator, BaseGeneratorConstructor, BaseGeneratorOptions, GetGeneratorConstructor, InstantiateOptions, PromptAnswers } from '@yeoman/types';
import type { DefaultEnvironmentApi, DefaultGeneratorApi } from '../types/type-helpers.js';
import { type DummyPromptOptions, TestAdapter, type TestAdapterOptions } from './adapter.js';
import RunContext, { BasicRunContext, type RunContextSettings } from './run-context.js';
export declare const setDefaultDummyParentClass: (parentClass: any) => void;
export type CreateEnv = (options: BaseEnvironmentOptions) => Promise<BaseEnvironment>;
/**
 * Dependencies can be path (autodiscovery) or an array [<generator>, <name>]
 */
export type Dependency = string | Parameters<DefaultEnvironmentApi['register']>;
/**
 * Collection of unit test helpers. (mostly related to Mocha syntax)
 * @class YeomanTest
 */
export declare class YeomanTest {
    settings?: RunContextSettings;
    environmentOptions?: BaseEnvironmentOptions;
    generatorOptions?: BaseGeneratorOptions;
    adapterOptions?: Omit<TestAdapterOptions, 'mockedAnswers'>;
    /**
     * @deprecated
     * Create a function that will clean up the test directory,
     * cd into it. Intended for use
     * as a callback for the mocha `before` hook.
     *
     * @param dir - path to the test directory
     * @returns mocha callback
     */
    setUpTestDirectory(dir: string): () => void;
    /**
     * @deprecated
     * Clean-up the test directory and cd into it.
     * Call given callback after entering the test directory.
     * @param dir - path to the test directory
     * @param cb - callback executed after setting working directory to dir
     * @example
     * testDirectory(path.join(__dirname, './temp'), function () {
     *   fs.writeFileSync('testfile', 'Roses are red.');
     * });
     */
    testDirectory(dir: string, callback?: (error?: any) => unknown): unknown;
    /**
     * @deprecated
     * Answer prompt questions for the passed-in generator
     * @param generator - a Yeoman generator or environment
     * @param answers - an object where keys are the
     *   generators prompt names and values are the answers to
     *   the prompt questions
     * @param options - Options or callback
     * @example
     * mockPrompt(angular, {'bootstrap': 'Y', 'compassBoostrap': 'Y'});
     */
    mockPrompt(environmentOrGenerator: BaseGenerator | DefaultEnvironmentApi, mockedAnswers?: PromptAnswers, options?: DummyPromptOptions): void;
    /**
     * @deprecated
     * Restore defaults prompts on a generator.
     * @param generator or environment
     */
    restorePrompt(environmentOrGenerator: BaseGenerator | DefaultEnvironmentApi): void;
    /**
     * @deprecated
     * Provide mocked values to the config
     * @param generator - a Yeoman generator
     * @param localConfig - localConfig - should look just like if called config.getAll()
     */
    mockLocalConfig(generator: BaseGenerator, localConfig: any): void;
    /**
     * Create a mocked generator
     */
    createMockedGenerator(GeneratorClass?: BaseGeneratorConstructor): ReturnType<typeof mock.fn>;
    /**
     * Create a simple, dummy generator
     */
    createDummyGenerator<const GenParameter extends new (...args: any[]) => BaseGenerator = BaseGeneratorConstructor>(Generator?: GenParameter, contents?: Record<string, (...arguments_: any[]) => void>): GenParameter;
    /**
     * Create a generator, using the given dependencies and controller arguments
     * Dependecies can be path (autodiscovery) or an array [{generator}, {name}]
     *
     * @param name - the name of the generator
     * @param dependencies - paths to the generators dependencies
     * @param args - arguments to the generator;
     *   if String, will be split on spaces to create an Array
     * @param options - configuration for the generator
     * @param localConfigOnly - passes localConfigOnly to the generators
     * @example
     *  var deps = ['../../app',
     *              '../../common',
     *              '../../controller',
     *              '../../main',
     *              [createDummyGenerator(), 'testacular:app']
     *            ];
     * var angular = createGenerator('angular:app', deps);
     */
    createGenerator<GeneratorType extends BaseGenerator = DefaultGeneratorApi>(name: string | GetGeneratorConstructor<GeneratorType>, options?: {
        dependencies?: Dependency[];
        localConfigOnly?: boolean;
    } & InstantiateOptions<GeneratorType>): Promise<GeneratorType>;
    /**
     * Shortcut to the Environment's createEnv.
     *
     * @param {...any} args - environment constructor arguments.
     * @returns {Object} environment instance
     *
     * Use to test with specific Environment version:
     * let createEnv;
     * before(() => {
     *   createEnv = stub(helper, 'createEnv').callsFake(Environment.creatEnv);
     * });
     * after(() => {
     *   createEnv.restore();
     * });
     */
    createEnv(options: BaseEnvironmentOptions): Promise<DefaultEnvironmentApi>;
    /**
     * Creates a test environment.
     *
     * @param {Function} - environment constructor method.
     * @param {Object} - Options to be passed to the environment
     * const env = createTestEnv(require('yeoman-environment').createEnv);
     */
    createTestEnv(environmentContructor?: CreateEnv, options?: BaseEnvironmentOptions): Promise<BaseEnvironment>;
    /**
     * Creates a TestAdapter using helpers default options.
     */
    createTestAdapter(options?: TestAdapterOptions): TestAdapter;
    /**
     * Get RunContext type
     * @return {RunContext}
     */
    getRunContextType(): typeof RunContext;
    /**
     * Run the provided Generator
     * @param GeneratorOrNamespace - Generator constructor or namespace
     */
    run<GeneratorType extends BaseGenerator = DefaultGeneratorApi>(GeneratorOrNamespace: string | GetGeneratorConstructor<GeneratorType>, settings?: RunContextSettings, environmentOptions?: BaseEnvironmentOptions): RunContext<GeneratorType>;
    /**
     * Prepare a run context
     * @param  {String|Function} GeneratorOrNamespace - Generator constructor or namespace
     * @return {RunContext}
     */
    create<GeneratorType extends BaseGenerator = DefaultGeneratorApi>(GeneratorOrNamespace: string | GetGeneratorConstructor<GeneratorType>, settings?: RunContextSettings, environmentOptions?: BaseEnvironmentOptions): RunContext<GeneratorType>;
    /**
     * Prepare temporary dir without generator support.
     * Generator and environment will be undefined.
     */
    prepareTemporaryDir(settings?: RunContextSettings): BasicRunContext<BaseGenerator>;
}
declare const defaultHelpers: YeomanTest;
export default defaultHelpers;
export declare const createHelpers: (options: any) => YeomanTest;
