import { Overlay } from '@angular/cdk/overlay'; import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { TsButtonComponent } from '@terminus/ui/button'; /** * Define the accepted string values for the {@link TsConfirmationOverlayComponent} position */ export declare type TsConfirmationOverlayPositionTypes = 'above' | 'below' | 'before' | 'after'; /** * Define the allowed tooltips Used by {@link TsConfirmationOverlayComponent} position */ export declare const allowedOverlayPositionTypes: TsConfirmationOverlayPositionTypes[]; /** * A directive to inject a confirmation step into any button * * @example * * Click me! * * * https://getterminus.github.io/ui-demos-release/components/confirmation */ export declare class TsConfirmationDirective implements OnDestroy, OnInit { private elementRef; private overlay; private host; private changeDetectorRef; /** * Store a reference to the created confirmation overlay */ private overlayInstance; /** * Store a reference to the overlay overlay */ private overlayRef; /** * Define the confirmation button text * * @param value */ set confirmationButtonText(value: string); get confirmationButtonText(): string; private _confirmationButtonText; /** * Define the cancel button text * * @param value */ set cancelButtonText(value: string); get cancelButtonText(): string; private _cancelButtonText; /** * Define the explanation text */ explanationText: string | undefined; /** * Define position of the overlay * * @param value */ set overlayPosition(value: TsConfirmationOverlayPositionTypes); get overlayPosition(): TsConfirmationOverlayPositionTypes; private _overlayPosition; /** * An event emitted when the confirmation is cancelled */ readonly cancelled: EventEmitter; constructor(elementRef: ElementRef, overlay: Overlay, host: TsButtonComponent, changeDetectorRef: ChangeDetectorRef); /** * Spawn the confirmation overlay on click * * NOTE: Even though the 'event' param is not used, the param must exist for AoT to pass. * * @param event */ onClick(event: Event): void; /** * Dismiss the confirmation overlay on pressing escape */ onKeydownHandler(): void; /** * Set a flag in the {@link TsButtonComponent} to intercept the click */ ngOnInit(): void; /** * Dismiss the overlay and clean up observables */ ngOnDestroy(): void; /** * Create and attach the confirmation overlay */ private createOverlay; /** * Configure the overlay * * @param value */ private generateOverlayConfig; /** * Dismiss the overlay */ private dismissOverlay; }