import { RspackPluginFunction, RspackPluginInstance } from "@rspack/core"; import { Plugin as EsbuildPlugin } from "esbuild"; import { Plugin } from "rolldown"; import { Plugin as RollupPlugin } from "rollup"; import { UnpluginInstance } from "unplugin"; import { Plugin as VitePlugin } from "vite"; import { Compiler, WebpackPluginInstance } from "webpack"; //#region src/types.d.ts type WebpackPlugin = ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance; type RspackPlugin = RspackPluginInstance | RspackPluginFunction; interface PluginMap { rollup: RollupPlugin; rolldown: Plugin; vite: VitePlugin; esbuild: EsbuildPlugin; webpack: WebpackPlugin; rspack: RspackPlugin; } type PluginType = keyof PluginMap; type Plugin$1 = PluginMap[PluginType]; type RemoveFalsy = Exclude; type Factory = (userOptions: UserOptions, meta: { framework?: PluginType; }) => CombineOptions; type FactoryOutput = [never] extends UserOptions ? () => Return : undefined extends UserOptions ? (options?: UserOptions) => Return : (options: UserOptions) => Return; type Unplugin = { instance: UnpluginInstance | UnpluginCombineInstance; options?: UserOptions; }; type Awaitable = T | Promise; type OptionsPlugin = Awaitable | Unplugin | Awaitable; interface CombineOptions { name: string; /** vite only */ enforce?: "post" | "pre" | undefined; plugins: OptionsPlugin; } interface UnpluginCombineInstance { rollup: FactoryOutput>; rolldown: FactoryOutput>; webpack: FactoryOutput; rspack: FactoryOutput; vite: FactoryOutput>; esbuild: FactoryOutput; raw: Factory; plugins: FactoryOutput; } //#endregion export { FactoryOutput as a, PluginMap as c, RollupPlugin as d, RspackPlugin as f, WebpackPlugin as g, VitePlugin as h, Factory as i, PluginType as l, UnpluginCombineInstance as m, CombineOptions as n, OptionsPlugin as o, Unplugin as p, EsbuildPlugin as r, Plugin$1 as s, Awaitable as t, RemoveFalsy as u };