import { Service } from './metadata'; import { Params } from '@angular/router'; import { Qualifier } from '@scion/workbench-application-platform.api'; /** * Displays a popup to the user. */ export declare class PopupService implements Service { /** * Opens a popup relative to the specified anchor with content as provided by a respective capability provider. * * @returns a promise that: * - resolves to the result if closed with a result * - resolves to `undefined` if closed without a result */ open(popup: Popup, qualifier: Qualifier): Promise; /** * Closes the popup which is currently showing this application. */ close(result?: any): void; onDestroy(): void; } /** * Specifies the location and optional queryParams and matrixParams of the popup to show. */ export interface Popup { /** * Specifies optional query parameters to open the popup. */ queryParams?: Params; /** * Specifies optional matrix parameters to open the popup. * * Matrix parameters can be used to associate optional data with the URL and are like regular URL parameters, * but do not affect route resolution. */ matrixParams?: Params; /** * Specifies the {Element} where to attach the popup. */ anchor: Element; /** * Specifies in which region of the popup anchor to show the popup (unless not enough space). */ position?: 'east' | 'west' | 'north' | 'south'; /** * Controls when to close the popup. By default, the popup closes on focus lost and escape keystroke. */ closeStrategy?: { /** * Specifies if to close the popup on focus lost, which is `true` by default. */ onFocusLost?: boolean; /** * Specifies if to close the popup on escape keystroke, which is `true` by default. */ onEscape?: boolean; /** * Specifies if to close the popup on workbench view grid change, which is `true` by default. */ onGridLayoutChange?: boolean; }; }