import { EventEmitter, Event as klEvent } from '@akala/core';
import type { Module, SpecialNextParam, MiddlewarePromise, Subscription, IEventSink, IEvent } from '@akala/core';
/**
* The main module for bootstrapping Akala client-side services.
*/
export declare const bootstrapModule: Module;
/**
* Module for registering core Akala services.
*/
declare const serviceModule: Module;
export { serviceModule };
/**
* Resolves a relative URL against the base URL defined in the document's tag.
* @param namespace The relative URL path to resolve.
* @returns The full resolved URL string.
*/
export declare function resolveUrl(namespace: string): string;
/**
* Decorator for registering a service with dependency injection.
* @param name The service identifier.
* @param toInject Dependency names to inject into the service constructor.
*/
export declare function service(name: string | symbol, ...toInject: string[]): (target: new (...args: unknown[]) => unknown) => void;
import { Container, type ICommandProcessor, Metadata, type StructuredParameters } from '@akala/commands/browser';
export { AttributeComposer, type WebComponent, webComponent, wcObserve, databind, type HtmlControlElement } from './behaviors/shared.js';
/**
* Command processor that handles events after remote processing.
*/
export declare class LocalAfterRemoteProcessor implements ICommandProcessor {
private readonly inner;
readonly eventEmitter: EventEmitter, Metadata.Command]>>>;
constructor(inner: ICommandProcessor, eventEmitter?: EventEmitter, Metadata.Command]>>>);
/**
* Handles a command and emits events on failure.
* @param origin The command origin container.
* @param cmd The command metadata.
* @param param The structured command parameters.
*/
handle(origin: Container, cmd: Metadata.Command, param: StructuredParameters): MiddlewarePromise;
}
export { FormInjector, FormComposer } from './behaviors/form.js';
export { IfComposer } from './behaviors/if.js';
export { DataBind, DataContext } from './behaviors/context.js';
export { EventComposer } from './behaviors/events.js';
export { CssClass, CssClassComposer } from './behaviors/cssClass.js';
export { I18nComposer } from './behaviors/i18n.js';
export { ClientBindings } from './client-bindings.js';
export * from './dom-helpers.js';
/**
* Event sink for client-side events.
*/
export type IClientEventSink = IEventSink<[TEvent], void, {
once?: boolean;
}>;
/**
* Event type for client-side events.
*/
export type IClientEvent = IEvent<[TEvent], void>;
/**
* Base class for client-side events with disposal support.
*/
export declare class ClientEvent extends klEvent<[TEvent], void> {
}
/**
* Subscribes to DOM events with cleanup management.
* @param item The HTML element to observe.
* @param eventName The event name or object mapping names to handlers.
* @param handler The event handler function.
* @returns Subscription(s) to manage event listeners.
*/
export declare function subscribe void;
}>>(item: HTMLElement, eventHandlers: T): Record;
export declare function subscribe(item: HTMLElement, eventName: T, handler: (ev: HTMLElementEventMap[T]) => void): Subscription;
/**
* Creates an `IClientEventSink` that listens for a specified event on a given `EventTarget`.
*
* @template TEventName - The name of the event to listen for, which must be a key of `HTMLElementEventMap`.
* @template TEvent - The type of the event object, which defaults to the event type corresponding to `TEventName` in `HTMLElementEventMap`.
*
* @param {EventTarget} x - The target to listen for events on.
* @param {TEventName} eventName - The name of the event to listen for.
* @returns {IClientEventSink} An `IClientEventSink` that emits the specified event.
*/
export declare function fromEvent(x: EventTarget, eventName: TEventName): IClientEventSink;
/**
* Creates a client event sink that pipes events from a specified event target.
*
* @param source - The source event sink that controls the subscription.
* @param x - The event target from which to listen for events.
* @param eventName - The name of the event to listen for on the event target.
* @returns A client event sink that emits events from the specified event target.
*
* @template TEventName - The type of the event name.
* @template TEvent - The type of the event.
*/
export declare function pipefromEvent(source: IEventSink<[boolean], void, {
once?: boolean;
}>, x: EventTarget, eventName: TEventName): IClientEventSink;