import type { Plugin } from "vite"; interface ViteDtsPluginOptions { /** Absolute path to the project's tsconfig.json. If omitted, declaration generation is skipped. */ tsconfigPath?: string; compilerOptions?: { /** Sets the root directory for resolving relative source paths in declarations. Maps to tsc's `--rootDir`. */ rootDir?: string; }; /** Glob patterns to exclude from declaration generation (e.g. `["**\/node_modules/**"]`). */ exclude?: string[]; } /** * Vite plugin that generates `.d.ts` declaration files by shelling out to `tsc`. * * Replaces `vite-plugin-dts` to avoid its transitive dependency on `@microsoft/api-extractor` * and the associated `@rushstack/*` ESM incompatibilities. * * The plugin hooks into `closeBundle` to run `tsc --emitDeclarationOnly` after Vite finishes * writing bundles. It creates a temporary tsconfig that extends the project's own, overriding * only the options needed for declaration emit (`declaration`, `emitDeclarationOnly`, `outDir`). * * @param options - Configuration matching the subset of `vite-plugin-dts` options we use. */ export default function vitePluginTscDts(options?: ViteDtsPluginOptions): Plugin; export {};