import { UnpluginExecutionOptions, UnpluginFactory } from "./types.mjs"; import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.mjs"; import { ExecutionContext, UnresolvedContext } from "@powerlines/core"; import { Plugin, RolldownOptions } from "rolldown"; //#region src/rolldown.d.ts declare const DEFAULT_OPTIONS: { keepNames: boolean; treeshake: boolean; shimMissingExports: boolean; transform: { target: string; }; }; /** * Resolves the options for [rolldown](https://rolldown.rs). * * @param context - The build context. * @returns The resolved options. */ declare function resolveOptions(context: TContext): RolldownOptions; /** * Creates a Rolldown plugin factory that generates a plugin instance. * * @see https://rolldown.rs/guide/en/#plugins-overview * * @example * ```ts * // rolldown.config.ts * import { createRolldownFactory } from "@powerlines/unplugin/rolldown"; * * const powerlinesPlugin = createRolldownFactory({ name: "example-app", ... }); * * export default defineConfig({ * plugins: [powerlinesPlugin()], * }); * * ``` * * @param options - The options to create the plugin factory with. * @param decorate - A function to decorate the plugin options with additional properties or hooks. This can be used to add custom behavior to the plugin instance, such as additional hooks or configuration options. The function receives the generated plugin options and should return an object containing any additional properties or hooks to be merged into the final plugin options. * @returns A function that generates a Rolldown plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your Rolldown build. */ declare function createRolldownFactory(options?: Omit, decorate?: UnpluginFactoryDecorator): UnpluginFactory>; /** * A Rolldown plugin that will invoke the Powerlines API hooks during the build process. * * @see https://rolldown.rs/guide/en/#plugins-overview * * @example * ```ts * // rolldown.config.ts * import powerlines from "@powerlines/unplugin/rolldown"; * * export default defineConfig({ * plugins: [powerlines({ name: "example-app", ... })], * }) * ``` */ declare const plugin: (options?: UnpluginExecutionOptions | undefined) => Plugin | Plugin[]; //#endregion export { DEFAULT_OPTIONS, createRolldownFactory, plugin as default, resolveOptions }; //# sourceMappingURL=rolldown.d.mts.map