import * as i0 from '@angular/core';
import { TemplateRef } from '@angular/core';
import { OverlayRef } from '@angular/cdk/overlay';

interface DropdownOverlay {
    open(triggerElement?: HTMLElement): void;
    close(): void;
    toggle(triggerElement?: HTMLElement): void;
    isOpen(): boolean;
}

/**
 * Generic directive that turns any element into a trigger for a dropdown component
 * implementing the DropdownOverlay interface.
 * Handles click and keyboard interactions to open/close the dropdown.
 */
declare class DropdownTriggerDirective {
    private readonly elementRef;
    /** Reference to the dropdown component that this trigger controls */
    apDropdownTrigger: i0.InputSignal<DropdownOverlay>;
    /** Handles click events to toggle the dropdown */
    onClick(event: MouseEvent): void;
    /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */
    onKeyDown(event: KeyboardEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DropdownTriggerDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownTriggerDirective, "[apDropdownTrigger]", never, { "apDropdownTrigger": { "alias": "apDropdownTrigger"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
}

interface DropdownOverlayConfig {
    showBackdrop?: boolean;
    defaultPosition?: 'right' | 'left';
    /** Called when the overlay is closed via backdrop click or Escape key. Typically routes to the component's own close() method. */
    onClose?: () => void;
}
/**
 * Creates a composable dropdown overlay helper that manages CDK overlay creation,
 * positioning, and disposal. Must be called within an Angular injection context
 * (e.g., in a component constructor or field initializer).
 */
declare function createDropdownOverlay(): {
    readonly overlayRef: OverlayRef | null;
    isOpen: i0.Signal<boolean>;
    open: (template: TemplateRef<unknown>, triggerElement?: HTMLElement, config?: DropdownOverlayConfig) => void;
    close: () => void;
};
type DropdownOverlayInstance = ReturnType<typeof createDropdownOverlay>;

export { DropdownTriggerDirective, createDropdownOverlay };
export type { DropdownOverlay, DropdownOverlayConfig, DropdownOverlayInstance };
