/**
 * Popover state class with trigger, content, and container attachments.
 *
 * `Popover` manages visibility, positioning, outside-click dismissal,
 * and ARIA attributes. The `trigger`, `content`, and `container`
 * attachments wire up the DOM via Svelte's `{@attach}` directive.
 *
 * For the common button + popover pattern, see `PopoverButton`.
 *
 * @example
 * ```svelte
 * <script lang="ts">
 * 	import {Popover} from '@fuzdev/fuz_app/ui/popover.svelte.js';
 *
 * 	const popover = new Popover();
 * </script>
 *
 * <div class="position:relative" {@attach popover.container}>
 * 	<button type="button" {@attach popover.trigger({position: 'bottom', align: 'center'})}>
 * 		toggle
 * 	</button>
 * 	{#if popover.visible}
 * 		<div {@attach popover.content({position: 'bottom', align: 'center'})}>
 * 			<button type="button" onclick={() => popover.hide()}>close</button>
 * 		</div>
 * 	{/if}
 * </div>
 * ```
 *
 * @example
 * ```ts
 * // programmatic control with callbacks
 * const popover = new Popover({
 * 	position: 'right',
 * 	align: 'start',
 * 	offset: '8px',
 * 	disable_outside_click: true,
 * 	onshow: () => console.log('opened'),
 * 	onhide: () => console.log('closed'),
 * });
 *
 * popover.show();
 * popover.toggle();
 * popover.hide();
 * ```
 *
 * @module
 */
import type { Attachment } from 'svelte/attachments';
import type { Snippet } from 'svelte';
import type { TransitionConfig } from 'svelte/transition';
import { type Position, type Alignment } from './position_helpers.js';
/**
 * Parameters for configuring the popover.
 */
export interface PopoverParameters {
    /** Position of the popover relative to its trigger. */
    position?: Position;
    /** Alignment along the position edge. */
    align?: Alignment;
    /** Distance from the position. */
    offset?: string;
    /** Whether to disable closing when clicking outside. */
    disable_outside_click?: boolean;
    /** Custom class for the popover content. */
    popover_class?: string;
    /** Optional callback when popover is shown. */
    onshow?: () => void;
    /** Optional callback when popover is hidden. */
    onhide?: () => void;
}
/**
 * Parameters for the popover trigger action.
 */
export interface PopoverTriggerParameters extends PopoverParameters {
    /** Content to render in the popover (as a snippet). */
    content?: Snippet;
}
/**
 * Support both Svelte transitions and custom transitions.
 */
export type TransitionFunction = (node: HTMLElement) => TransitionConfig | {
    destroy?: () => void;
};
/**
 * Parameters for the popover content action.
 */
export interface PopoverContentParameters extends PopoverParameters {
}
/**
 * Class that manages state and provides actions for popovers.
 */
export declare class Popover {
    #private;
    /** Whether the popover is currently visible. */
    visible: boolean;
    /** Position of the popover relative to its trigger. */
    position: Position;
    /** Alignment along the position edge. */
    align: Alignment;
    /** Distance from the position. */
    offset: string;
    /** Whether to disable closing when clicking outside. */
    disable_outside_click: boolean;
    /** Custom class for the popover. */
    popover_class: string;
    constructor(params?: PopoverParameters);
    /**
     * Updates the popover configuration. Swaps `popover_class` on the live
     * content element when supplied and re-syncs the outside-click handler
     * if `disable_outside_click` changed.
     *
     * @mutates `this`
     */
    update(params: PopoverParameters): void;
    /**
     * Shows the popover, registering the outside-click handler and updating
     * `aria-expanded` on the trigger. No-ops when already visible.
     *
     * @mutates `this`
     */
    show(): void;
    /**
     * Hides the popover, removing the outside-click handler. No-ops when
     * already hidden.
     *
     * @mutates `this`
     */
    hide(): void;
    /**
     * Toggles the popover visibility, or sets it to the given value.
     *
     * @param visible - desired visibility (defaults to the inverse of current)
     * @mutates `this`
     */
    toggle(visible?: boolean): void;
    /**
     * Attachment for the container element.
     */
    container: Attachment<HTMLElement>;
    /**
     * Attachment factory for the trigger element that shows/hides the popover.
     */
    trigger: (params?: PopoverTriggerParameters) => Attachment<HTMLElement>;
    /**
     * Attachment factory for the popover content element.
     */
    content: (params?: PopoverContentParameters) => Attachment<HTMLElement>;
}
//# sourceMappingURL=popover.svelte.d.ts.map