import { UnpluginExecutionOptions, UnpluginFactory } from "./types.mjs"; import { UnpluginFactoryDecorator, UnpluginFactoryOptions } from "./unplugin.mjs"; import { ExecutionContext, ResolvedEntryFileReference, UnresolvedContext } from "@powerlines/core"; import { DeepPartial } from "@stryke/types/base"; import { BuildOptions } from "esbuild"; //#region src/esbuild.d.ts declare const DEFAULT_OPTIONS: Partial; /** * Resolves the entry options for esbuild. * * @param context - The build context. * @param entryPoints - The entry points to resolve. * @returns The resolved entry options. */ declare function resolveEntry(context: TContext, entryPoints?: ResolvedEntryFileReference[] | string[]): BuildOptions["entryPoints"]; /** * Resolves the esbuild options. * * @param context - The build context. * @param override - Optional esbuild options to override the resolved options. * @returns The resolved esbuild options. */ declare function resolveOptions(context: TContext, override?: DeepPartial): BuildOptions; /** * Creates an ESBuild plugin factory that generates a plugin instance. * * @see https://esbuild.github.io/plugins/ * * @example * ```ts * // esbuild.config.ts * import { createEsbuildFactory } from "@powerlines/unplugin/esbuild"; * * const powerlinesPlugin = createEsbuildFactory({ 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 an ESBuild plugin instance when called. The generated plugin will invoke the Powerlines API hooks during the build process, allowing you to integrate Powerlines into your ESBuild build. */ declare function createEsbuildFactory(options?: Omit, decorate?: UnpluginFactoryDecorator): UnpluginFactory>; /** * An ESBuild plugin that will invoke the Powerlines API hooks during the build process. * * @see https://esbuild.github.io/plugins/ * * @example * ```js * // esbuild.config.js * import powerlines from "@powerlines/unplugin/esbuild"; * * export default { * plugins: [powerlines({ name: "example-app", ... })], * }; * * ``` */ declare const plugin: (options?: UnpluginExecutionOptions | undefined) => import("esbuild").Plugin; //#endregion export { DEFAULT_OPTIONS, createEsbuildFactory, plugin as default, resolveEntry, resolveOptions }; //# sourceMappingURL=esbuild.d.mts.map