import { t as __name } from "./rolldown-runtime-C0LytTxp.js"; import { Plugin } from "@kubb/core"; //#region src/types.d.ts /** * Barrel export strategy. * * - `'all'` generates `export * from '...'` for every file * - `'named'` generates `export { name1, name2 } from '...'` using each file's named exports */ type BarrelType = 'all' | 'named'; /** * Barrel configuration at the root config level. * * @example * ```ts * barrel: { type: 'named' } * barrel: { type: 'all' } * barrel: false // no barrel generated (default) * ``` */ type BarrelConfig = { /** * Export strategy for the root barrel file. * - `'all'` wildcard exports: `export * from './file'` * - `'named'` explicit exports: `export { x, y } from './file'` */ type: BarrelType; }; /** * Barrel configuration at the plugin level. * Supports nested barrel generation in subdirectories. * * @example * ```ts * barrel: { type: 'named' } // single barrel with named exports * barrel: { type: 'all', nested: true } // hierarchical barrels with wildcard exports * barrel: { type: 'named', nested: true } // hierarchical barrels with named exports * barrel: false // no barrel generated (default) * ``` */ type PluginBarrelConfig = { /** * Export strategy for the plugin's barrel files. * - `'all'` wildcard exports: `export * from './file'` * - `'named'` explicit exports: `export { x, y } from './file'` */ type: BarrelType; /** * Generate an `index.ts` in every sub-directory, each re-exporting only what's directly inside it. * Creates a hierarchical barrel structure instead of flat exports from the root. */ nested?: boolean; }; //#endregion //#region src/plugin.d.ts declare global { namespace Kubb { interface PluginOptionsRegistry { output: { /** * Barrel configuration for this plugin's output. * Set to `{ type: 'named' | 'all' }` to opt this plugin into a barrel. Set to `false` * (the default) to disable barrel generation for this plugin entirely, which also * excludes the plugin's files from the root barrel. * * Falls back to `config.output.barrel` when omitted. * * @default false */ barrel?: PluginBarrelConfig | false; }; } interface ConfigOptionsRegistry { output: { /** * Barrel configuration for the root barrel file at `config.output.path/index.ts`. * Set to `{ type: 'named' | 'all' }` to opt into a root barrel. Individual plugins can * override this via their own `output.barrel`. * * @default false */ barrel?: BarrelConfig | false; }; } } } /** * Canonical plugin name for `@kubb/plugin-barrel`. Used for driver lookups * and to guard the `kubb:plugin:end` handler against reacting to its own lifecycle hook. */ declare const pluginBarrelName = "plugin-barrel"; /** * Generates an `index.ts` for every plugin output directory and one root * barrel at `config.output.path/index.ts` after the build completes. Ships * with Kubb and is registered by default in `defineConfig`, but generates * nothing until a barrel is configured. * * Each plugin inherits `output.barrel` from `config.output.barrel` (which * defaults to `false`, no barrel). Set `barrel: { type: 'named' | 'all' }` on * the root config, a plugin, or both to opt in; a plugin-level `false` * overrides an enabled root barrel and also excludes that plugin's files * from the root barrel. * * A plugin with `output.mode: 'file'` gets no per-plugin barrel, since its output * is a single file. The root barrel re-exports that file directly. * * @example * ```ts * import { defineConfig } from '@kubb/core' * import { pluginBarrel } from '@kubb/plugin-barrel' * import { pluginTs } from '@kubb/plugin-ts' * import { pluginZod } from '@kubb/plugin-zod' * * export default defineConfig({ * input: './petStore.yaml', * output: { path: 'src/gen', barrel: { type: 'named' } }, * plugins: [ * pluginTs({ output: { path: 'types', barrel: { type: 'all' } } }), * pluginZod({ output: { path: 'schemas' } }), * pluginBarrel(), * ], * }) * ``` */ declare const pluginBarrel: (options?: object | undefined) => Plugin>; //#endregion export { type BarrelConfig, type BarrelType, type PluginBarrelConfig, pluginBarrel, pluginBarrelName }; //# sourceMappingURL=index.d.ts.map