import { OverlayRef } from '@angular/cdk/overlay';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export interface QdPopoverAutoSizeConfig {
    width?: boolean;
    height?: boolean;
}
export interface QdPopoverSizeConstraints {
    minWidth?: number | 'none';
    maxWidth?: number | 'none';
    maxHeight?: number | 'none';
}
/**
 * **QdPopoverSizingService**
 *
 * A utility service to dynamically size and constrain popover overlays in Angular applications.
 *
 * This service is designed for use with popover components created via Angular CDK Overlay. It
 * ensures that popovers automatically fit their host or content, respect min/max constraints, and
 * respond to live size changes (e.g. window resize).
 *
 * #### Features:
 * - Dynamically measures popover content width and height, even if hidden.
 * - Applies minWidth, maxWidth, and maxHeight constraints.
 * - Optionally auto-sizes popover overlays to match host or content size (width/height).
 * - Supports smooth, flicker-free opening via overlay opacity control.
 * - Cleans up all listeners and state on disconnect.
 * - Exposes latest measured content size for debugging or analytics.
 *
 * #### Notes & Best Practices
 * - Internally, the service uses a hidden DOM clone to measure popover content, following best-practice patterns for measuring off-screen elements.
 * - Use the `contentWidth` and `contentHeight` getters for debugging or if you need to react to the last measured content size.
 * - The service will automatically hide the overlay until sizing is complete, preventing layout flicker.
 * - The returned Observable emits `true` once initial sizing is applied and overlay is visible.
 * - Even if autosize is turned off, the minimum and maximum width or height constraints are always enforced as hard limits.
 * - This means the popover can never be smaller or larger than the values you set, no matter what content it contains.
 *
 * #### For the hidden-content measuring
 * @see https://stackoverflow.com/questions/1841124/find-the-potential-width-of-a-hidden-element
 */
export declare class QdPopoverSizingService {
    private _resizeObserver?;
    private _host?;
    private _popover?;
    private _autoSize?;
    private _constraints?;
    private _overlayRef?;
    private _ready$?;
    private _contentWidth;
    private _contentHeight;
    get contentWidth(): number;
    get contentHeight(): number;
    observe(host: HTMLElement, popover: HTMLElement, overlayRef: OverlayRef, autoSize: QdPopoverAutoSizeConfig, constraints: QdPopoverSizeConstraints): Observable<boolean>;
    private showOverlay;
    private hideOverlay;
    private applySize;
    private measureContentSize;
    disconnect(): void;
    private clamp;
    static ɵfac: i0.ɵɵFactoryDeclaration<QdPopoverSizingService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<QdPopoverSizingService>;
}
//# sourceMappingURL=popover-sizing.service.d.ts.map