UNPKG

@stacksjs/dtsx

Version:

A modern, fast .d.ts generation tool, powered by Bun.

50 lines (49 loc) 1.12 kB
import type { DtsGenerationConfig, GenerationStats } from '../types'; /** * Create a Vite plugin for dtsx * * @example * ```ts * // vite.config.ts * import { dts } from '@stacksjs/dtsx/plugins/vite' * * export default { * plugins: [ * dts({ * root: './src', * outdir: './dist', * }), * ], * } * ``` */ export declare function dts(options?: VitePluginOptions): VitePlugin; /** * Alias for dts */ export declare const viteDts: typeof dts; /** * Vite plugin options */ export declare interface VitePluginOptions extends Partial<DtsGenerationConfig> { buildStart?: boolean buildEnd?: boolean writeBundle?: boolean modes?: string[] onGenerated?: (stats: GenerationStats) => void onError?: (error: Error) => void } /** * Vite plugin interface (minimal type for compatibility) */ declare interface VitePlugin { name: string apply?: 'build' | 'serve' | ((_config: { mode: string }) => boolean) buildStart?: () => Promise<void> | void buildEnd?: () => Promise<void> | void writeBundle?: () => Promise<void> | void } /** * Default export */ export default dts;