import { Plugin } from 'rollup';
import { UnbuildResolvedOptions } from '../types.js';
import '@storm-software/build-tools';
import 'esbuild';
import 'mkdist';
import 'unbuild';

/**
 * This plugin takes all entry-points from the generated bundle and creates a
 * bundled version of corresponding d.ts files.
 *
 * For example, `src/index.ts` generates two corresponding files:
 * - `dist/xyz/index.js`
 * - `dist/xyz/src/index.d.ts`
 *
 * We want a third file: `dist/index.d.ts` that re-exports from `src/index.d.ts`.
 * That way, when TSC or IDEs look for types, it will find them in the right place.
 *
 * @param projectRoot - The root of the project.
 * @returns The Rollup plugin.
 */
declare function typeDefinitionsPlugin(options: UnbuildResolvedOptions): Plugin;

export { typeDefinitionsPlugin };
