import { Type, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { NgOverlayContainerConfiguration, NgPopoverCloseType } from 'ng-overlay-container';
import { AbstractTransitionWatcherDirective, DbxInjectionComponentConfig } from '@dereekb/dbx-core';
import { LockSet } from '@dereekb/rxjs';
import { Maybe, PromiseOrValue, SpaceSeparatedCssClasses } from '@dereekb/util';
import { DbxPopoverController, DbxPopoverKey } from './popover';
import * as i0 from "@angular/core";
export declare abstract class DbxPopoverComponentController<O, I> extends DbxPopoverController<O, I> {
    getClosingValueFn?: (value?: I) => Promise<O>;
}
export interface DbxPopoverComponentConfig<O, I, T> {
    /**
     * Key used for uniquely identifying a limited instance.
     *
     * Only one popover should exist at a time given a certain key.
     */
    readonly key: DbxPopoverKey;
    /**
     * Origin element to position on.
     */
    readonly origin: ElementRef;
    /**
     * Whether or not to close if a transition occurs.
     */
    readonly closeOnTransition?: boolean;
    /**
     * Whether or not to dismiss when the escape button is pressed.
     *
     * False by default.
     */
    readonly closeOnEscape?: boolean;
    /**
     * Component to inject into the popover.
     */
    readonly componentClass: Type<T>;
    /**
     * Panel classes to add to the popover.
     */
    readonly panelClass?: Maybe<SpaceSeparatedCssClasses>;
    /**
     * Data available to the popover.
     */
    readonly data?: Maybe<I>;
    /**
     * Optional function to initialize the popover component.
     *
     * @param component
     * @param controller
     */
    readonly init?: (component: T, controller: DbxPopoverController<O, I>) => void;
}
export interface FullDbxPopoverComponentConfig<O, I, T> extends DbxPopoverComponentConfig<O, I, T> {
    configuration: NgOverlayContainerConfiguration;
}
/**
 * Popover component.
 */
export declare class DbxPopoverComponent<O = unknown, I = unknown, T = unknown> extends AbstractTransitionWatcherDirective implements DbxPopoverController<O, I>, OnInit, OnDestroy {
    private readonly popoverRef;
    private readonly compactContextState;
    readonly lockSet: LockSet;
    readonly contentConfig: DbxInjectionComponentConfig;
    private _startedClosing;
    private readonly _closing;
    private _triggerCloseKeys;
    readonly isClosing$: import("rxjs").Observable<boolean>;
    readonly closing$: import("rxjs").Observable<boolean>;
    getClosingValueFn?: (value: Maybe<I>, closeType: NgPopoverCloseType) => PromiseOrValue<O | undefined>;
    constructor();
    get config(): FullDbxPopoverComponentConfig<O, I, T>;
    get panelClass(): Maybe<SpaceSeparatedCssClasses>;
    get key(): DbxPopoverKey;
    get data(): Maybe<I>;
    get triggerCloseKeys(): string[];
    ngOnInit(): void;
    ngOnDestroy(): void;
    protected updateForSuccessfulTransition(): void;
    close(): void;
    return(value?: O | undefined): void;
    private _useClosingValue;
    handleKeydown(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DbxPopoverComponent<any, any, any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DbxPopoverComponent<any, any, any>, "ng-component", never, {}, {}, never, never, true, never>;
}
