import { type HttpContext } from '@adonisjs/core/http'; import { type ApplicationService, type HttpRouterService } from '@adonisjs/core/types'; import { type Config, type PartialConfig } from '../src/define_config.js'; import Livewire from '../src/livewire.js'; /** * Parameters for configuring the Livewire factory */ type FactoryParameters = { /** HTTP context for the request */ ctx: HttpContext; /** Application service instance */ app: ApplicationService; /** HTTP router service */ router: HttpRouterService; /** Livewire configuration object */ config: Config; }; /** * Livewire factory to quickly create a new instance of Livewire * for testing purposes * * @example * ```typescript * const factory = new LivewireFactory() * const livewire = factory * .merge({ config: { injectAssets: false } }) * .create() * ``` */ export declare class LivewireFactory { #private; /** * Creates a new LivewireFactory instance with default Livewire headers * * @param app - Application service instance (optional, will create a mock if not provided) * * @example * ```typescript * const factory = new LivewireFactory(app, { injectAssets: false }) * ``` */ constructor(app: ApplicationService, config?: Config, router?: HttpRouterService); /** * Merges additional parameters into the factory configuration * * @param parameters - Partial factory parameters to merge * * @example * ```typescript * factory.merge({ * config: { injectAssets: false }, * ctx: customContext * }) * ``` */ merge(parameters: Omit, 'config' | 'app'> & { config?: PartialConfig; }): this; /** * Removes the X-Livewire header from the request headers * * @example * ```typescript * const livewire = factory.withoutLivewire().create() * ``` */ withoutLivewire(): this; /** * Sets the X-Livewire-Navigate header for navigation requests * * @example * ```typescript * const livewire = factory.withNavigate().create() * ``` */ withNavigate(): this; /** * Sets the X-Livewire-Stream header for streaming responses * * @example * ```typescript * const livewire = factory.withStream().create() * ``` */ withStream(): this; /** * Creates a new Livewire instance with the configured parameters * * @example * ```typescript * const livewire = factory * .merge({ config: customConfig }) * .create() * ``` */ create(): Livewire; /** * Gets the current HTTP context * * @example * ```typescript * const ctx = factory.getContext() * ``` */ getContext(): HttpContext; /** * Gets the current application service * * @example * ```typescript * const app = factory.getApp() * ``` */ getApp(): ApplicationService; /** * Gets the current configuration * * @example * ```typescript * const config = factory.getConfig() * ``` */ getConfig(): Config; } export {};