import { ResolvedFile } from "./index-CGJ3tdk-.js";
import { Logger } from "./logger-B-4AXUmB.js";
import { BarrelType, Config, FileManager, FileMetaBase, GetPluginFactoryOptions, Group, InputData, InputPath, Output, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PossiblePromise, ResolveNameParams, ResolvePathParams, UserConfig, UserPlugin, UserPluginWithLifeCycle, getSource } from "./PluginManager-BSUDeUfP.js";
import { getDefaultBanner } from "./index-BhFFCWR1.js";

//#region src/BaseGenerator.d.ts
/**
 * Abstract class that contains the building blocks for plugins to create their own Generator
 * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
 */
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
  #private;
  constructor(options?: TOptions, context?: TContext);
  get options(): TOptions;
  get context(): TContext;
  set options(options: TOptions);
  abstract build(...params: unknown[]): unknown;
}
//#endregion
//#region src/build.d.ts
type BuildOptions = {
  config: UserConfig;
  /**
   * @default Logger without the spinner
   */
  logger?: Logger;
  pluginManager?: PluginManager;
};
type BuildOutput = {
  files: Array<ResolvedFile>;
  pluginManager: PluginManager;
  /**
   * Only for safeBuild
   */
  error?: Error;
};
declare function setup(options: BuildOptions): Promise<PluginManager>;
declare function build(options: BuildOptions): Promise<BuildOutput>;
declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
//#endregion
//#region src/config.d.ts
type Args = {
  /**
   * Path to `kubb.config.js`
   */
  config?: string;
  /**
   * Watch changes on input
   */
  watch?: boolean;
  /**
   * Log level to report when using the CLI
   *
   * `silent` will hide all information that is not relevant
   *
   * `info` will show all information possible(not related to the PluginManager)
   *
   * `debug` will show all information possible(related to the PluginManager), handy for seeing logs
   * @default `silent`
   */
  logLevel?: string;
  /**
   * Run Kubb with Bun
   */
  bun?: boolean;
};
/**
 * Type helper to make it easier to use vite.config.ts accepts a direct UserConfig object, or a function that returns it. The function receives a ConfigEnv object.
 */
declare function defineConfig(options: PossiblePromise<UserConfig | Array<UserConfig>> | ((/** The options derived from the CLI flags */
args: Args) => PossiblePromise<UserConfig | Array<UserConfig>>)): typeof options;
declare function isInputPath(result: UserConfig | undefined): result is UserConfig<InputPath>;
//#endregion
//#region src/PackageManager.d.ts
type PackageJSON = {
  dependencies?: Record<string, string>;
  devDependencies?: Record<string, string>;
};
type DependencyName = string;
type DependencyVersion = string;
declare class PackageManager {
  #private;
  constructor(workspace?: string);
  set workspace(workspace: string);
  get workspace(): string | undefined;
  normalizeDirectory(directory: string): string;
  getLocation(path: string): string;
  import(path: string): Promise<any | undefined>;
  getPackageJSON(): Promise<PackageJSON | undefined>;
  getPackageJSONSync(): PackageJSON | undefined;
  static setVersion(dependency: DependencyName, version: DependencyVersion): void;
  getVersion(dependency: DependencyName | RegExp): Promise<DependencyVersion | undefined>;
  getVersionSync(dependency: DependencyName | RegExp): DependencyVersion | undefined;
  isValid(dependency: DependencyName | RegExp, version: DependencyVersion): Promise<boolean>;
  isValidSync(dependency: DependencyName | RegExp, version: DependencyVersion): boolean;
}
//#endregion
//#region src/utils/executeStrategies.d.ts
type PromiseFunc$1<T = unknown, T2 = never> = (state?: T) => T2 extends never ? Promise<T> : Promise<T> | T2;
type ValueOfPromiseFuncArray<TInput extends Array<unknown>> = TInput extends Array<PromiseFunc$1<infer X, infer Y>> ? X | Y : never;
type SeqOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = Promise<Array<Awaited<ValueOfPromiseFuncArray<TInput>>>>;
/**
 * Chains promises
 */

type HookFirstOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue = unknown> = ValueOfPromiseFuncArray<TInput>;
/**
 * Chains promises, first non-null result stops and returns
 */

type HookParallelOutput<TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = Promise<PromiseSettledResult<Awaited<ValueOfPromiseFuncArray<TInput>>>[]>;
/**
 * Runs an array of promise functions with optional concurrency limit.
 */

type Strategy = 'seq' | 'first' | 'parallel';
type StrategySwitch<TStrategy extends Strategy, TInput extends Array<PromiseFunc$1<TValue, null>>, TValue> = TStrategy extends 'first' ? HookFirstOutput<TInput, TValue> : TStrategy extends 'seq' ? SeqOutput<TInput, TValue> : TStrategy extends 'parallel' ? HookParallelOutput<TInput, TValue> : never;
//#endregion
//#region src/PromiseManager.d.ts
type PromiseFunc<T = unknown, T2 = never> = () => T2 extends never ? Promise<T> : Promise<T> | T2;
type Options<TState = any> = {
  nullCheck?: (state: TState) => boolean;
};
declare class PromiseManager<TState = any> {
  #private;
  constructor(options?: Options<TState>);
  run<TInput extends Array<PromiseFunc<TValue, null>>, TValue, TStrategy extends Strategy, TOutput = StrategySwitch<TStrategy, TInput, TValue>>(strategy: TStrategy, promises: TInput, {
    concurrency
  }?: {
    concurrency?: number;
  }): TOutput;
}
//#endregion
//#region src/plugin.d.ts
type PluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => UserPluginWithLifeCycle<T>;
type OptionalPluginFactory<T extends PluginFactoryOptions = PluginFactoryOptions> = (options?: T['options']) => UserPluginWithLifeCycle<T>;
declare function createPlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(factory: PluginFactory<T>): OptionalPluginFactory<T>;
//#endregion
export { BarrelType, BaseGenerator, Config, FileManager, type FileMetaBase, GetPluginFactoryOptions, Group, InputData, InputPath, Output, PackageManager, Plugin, PluginContext, PluginFactoryOptions, PluginKey, PluginLifecycle, PluginLifecycleHooks, PluginManager, PluginParameter, PluginWithLifeCycle, PromiseManager, ResolveNameParams, ResolvePathParams, UserConfig, UserPlugin, UserPluginWithLifeCycle, build, createPlugin, build as default, defineConfig, getDefaultBanner, getSource, isInputPath, safeBuild, setup };
//# sourceMappingURL=index.d.ts.map