import { UnpluginFactory } from "./types.cjs"; import { CustomLogger, ExecutionContext, Options, UnpluginBuilderVariant, UnpluginOptions } from "@powerlines/core"; export * from "@powerlines/core/lib/unplugin"; //#region src/unplugin.d.ts /** * The options required to create a Powerlines unplugin factory, which generates a plugin instance for a specific build variant and allows for optional customization of logging and framework identification. */ interface UnpluginFactoryOptions extends Options { /** * The build variant for which to create the unplugin. * * @remarks * This option is required to ensure that the unplugin is built with the correct configuration and behavior for the intended build tool or framework. The variant will determine how the unplugin integrates with the build process and which hooks it will call during execution. */ variant: UnpluginBuilderVariant; /** * An optional string prefix to use for virtual module IDs. This can be useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself. If not provided, the default prefix `__powerlines-virtual:` will be used. * * @defaultValue "\\0" */ virtualModulePrefix?: string | false; /** * A custom logger instance that implements the {@link CustomLogger} interface, which can be used for logging messages during the build process instead of the default Powerlines logger. * * @remarks * Providing a custom logger allows you to integrate Powerlines logging with your own logging system or to customize the logging behavior, such as formatting log messages differently or sending logs to an external service. If a custom logger is not provided, Powerlines will use its default logger implementation. */ customLogger?: CustomLogger; } type UnpluginFactoryDecorator = (options: UnpluginOptions) => Partial>; /** * Creates a Powerlines unplugin factory that generates a plugin instance. * * @remarks * The factory will handle loading the Powerlines configuration, resolving the plugin configuration, and executing the appropriate hooks during the build process. It also allows for optional customization of logging and framework identification through the provided options. * * @example * ```ts * import { createUnpluginFactory } from "@powerlines/unplugin"; * * const factory = createUnpluginFactory({ * variant: "vite", * framework: "my-framework", * orgId: "my-org", * customLogger: myCustomLogger * }); * * const plugin = createVitePlugin(factory); * export default plugin; * ``` * * @param options - The options for the unplugin factory, including the build variant and an optional custom logger. * @param decorate - An optional function to decorate the unplugin options. * @returns The unplugin factory that generates a plugin instance. */ declare function createUnpluginFactory(options: UnpluginFactoryOptions, decorate?: UnpluginFactoryDecorator): UnpluginFactory; //#endregion export { UnpluginFactoryDecorator, UnpluginFactoryOptions, createUnpluginFactory }; //# sourceMappingURL=unplugin.d.cts.map