import { ConnectOptions, Qualifier, Capability, ParamDefinition } from '@scion/microfrontend-platform';
import { Dictionary } from '@scion/toolkit/util';
import { Observable } from 'rxjs';
import { PreDestroy } from '@scion/toolkit/bean-manager';

/**
 * **SCION Workbench Client provides core API for a web app to interact with SCION Workbench and other microfrontends.**
 *
 * It is a pure TypeScript library based on the framework-agnostic `@scion/microfrontend-platform` library and can be used with any web stack.
 *
 * You can use the `Beans` object to get references to services to interact with the SCION Workbench and the SCION Microfrontend Platform.
 *
 * #### Core services include:
 *
 * - {@link WorkbenchRouter} for navigating to a microfrontend in a workbench view.
 * - {@link WorkbenchView} for the microfrontend to interact with the view.
 * - {@link WorkbenchDialogService} for displaying a microfrontend in a dialog.
 * - {@link WorkbenchDialog} for the microfrontend to interact with the dialog.
 * - {@link WorkbenchPopupService} for displaying a microfrontend in a popup.
 * - {@link WorkbenchPopup} for the microfrontend to interact with the popup.
 * - {@link WorkbenchMessageBoxService} for displaying a message.
 * - {@link WorkbenchMessageBox} for the microfrontend to interact with the message box.
 * - {@link WorkbenchNotificationService} for displaying a notification.
 * - `MessageClient` for sending or receiving messages between micro applications.
 * - `IntentClient` for issuing or receiving intents between micro applications.
 * - `ManifestService` for reading and registering capabilities at runtime.
 * - `SciRouterOutletElement` for embedding microfrontends.
 * - `OutletRouter` for navigating to a site in a router outlet element.
 * - `ContextService` for looking up contextual data set on a router outlet.
 * - `PreferredSizeService` for a microfrontend to report its preferred size.
 * - `FocusMonitor` for observing if the microfrontend has received focus or contains embedded web content that has received focus.
 *
 * For example, you can obtain the workbench router as follows:
 *
 * ```ts
 * const router = Beans.get(WorkbenchRouter)
 * ```
 *
 * Below is a summary of the core concepts of the SCION Microfrontend Platform.
 *
 * #### Host Application and Micro Applications
 * The host application, sometimes also called the container application, provides the top-level integration container for microfrontends. Typically, it is the web app
 * which the user loads into his browser and provides the main application shell, defining areas to embed microfrontends. The host application has SCION Workbench installed,
 * registers micro apps and starts the SCION Microfrontend Platform in host mode.
 *
 * A micro application deals with well-defined business functionality. It is a regular web application that provides one or more microfrontends. SCION Microfrontend Platform
 * uses iframes to embed microfrontends; thus, any web page can be integrated as a microfrontend. A micro application can communicate with other micro applications safely
 * using the platform's cross-origin messaging API. A micro application has to provide an application manifest which to register in the host application.
 *
 * For more information, see the chapter [Core Concepts](https://microfrontend-platform-developer-guide.scion.vercel.app/#_core_concepts)
 * of the SCION Microfrontend Platform Developer's Guide.
 *
 * #### Embedding of Microfrontends
 * You can embed microfrontends using the `<sci-router-outlet>` web component. Web content displayed in the web component is controlled via the `OutletRouter`.
 *
 * For more information, see the chapter [Embedding Microfrontends](https://microfrontend-platform-developer-guide.scion.vercel.app/#chapter:embedding-microfrontends)
 * of the SCION Microfrontend Platform Developer's Guide.
 *
 * #### Cross-Application Communication
 * You can interact with other micro applications via messaging or through so-called intents. Intents are a mechanism known from Android development,
 * enabling controlled collaboration across application boundaries.
 *
 * For more information, see the chapters [Cross-Application Communication](https://microfrontend-platform-developer-guide.scion.vercel.app/#chapter:cross-application-communication)
 * and [Intention API](https://microfrontend-platform-developer-guide.scion.vercel.app/#chapter:intention-api) of the SCION Microfrontend Platform Developer's Guide.
 *
 * #### Activation
 * You can provide an activator to connect to the platform when the user loads the host app into his browser, allowing to initialize and install message listeners for interacting
 * with other micro applications. Starting an activator may take some time. In order not to miss any messages, you can instruct the platform host to wait until you signal
 * readiness.
 *
 * For more information, see the chapter [Activator](https://microfrontend-platform-developer-guide.scion.vercel.app/#chapter:activator) of the SCION Microfrontend
 * Platform Developer's Guide.
 *
 * See our [Developer's Guide](https://microfrontend-platform-developer-guide.scion.vercel.app) for the full documentation about the
 * [SCION Microfrontend Platform](https://github.com/SchweizerischeBundesbahnen/scion-microfrontend-platform).
 */
declare class WorkbenchClient {
    private constructor();
    /**
     * Connects the micro application to the SCION Workbench and SCION Microfrontend Platform.
     *
     * After connected, the micro application can interact with the workbench and other micro applications. Typically, the
     * micro application connects to the workbench during the bootstrapping. In Angular, for example, this can be done in
     * an app initializer.
     *
     * See {@link @scion/microfrontend-platform!MicrofrontendPlatformClient.connect} for more information about connecting to the platform host.
     *
     * @param  symbolicName - Specifies the symbolic name of the micro application. The micro application needs to be registered
     *         in the workbench under that identity.
     * @param  connectOptions - Controls how to connect to the workbench.
     * @return A Promise that resolves once connected to the workbench, or that rejects otherwise.
     */
    static connect(symbolicName: string, connectOptions?: ConnectOptions): Promise<void>;
}

/**
 * Excludes all keys from T, resulting in an empty object `{}`.
 */
type Empty<T> = {
    [Key in keyof T]: never;
};

/**
 * Enables navigation of workbench views.
 *
 * A view is a visual workbench element for displaying content side-by-side or stacked.
 *
 * A microfrontend provided as a view capability can be opened in a view. The qualifier differentiates between different
 * view capabilities. An application can open the public view capabilities of other applications if it manifests a respective
 * intention.
 *
 * @category Router
 * @category View
 */
declare class WorkbenchRouter {
    /**
     * Navigates to a microfrontend of a view capability based on the given qualifier and extras.
     *
     * By default, the router opens a new view if no view is found that matches the specified qualifier and required params. Optional parameters do not affect view resolution.
     * If one or more views match the qualifier and required params, they will be navigated instead of opening the microfrontend in a new view tab.
     * This behavior can be changed by setting an explicit navigation target in navigation extras.
     *
     * @param  qualifier - Identifies the view capability that provides the microfrontend to display in a view.
     *                     Passing an empty qualifier (`{}`) allows the microfrontend to update its parameters, restoring updated parameters when the page reloads.
     *                     Parameter handling can be controlled using the {@link WorkbenchNavigationExtras#paramsHandling} option.
     * @param  extras - Options to control navigation.
     * @return Promise that resolves to `true` on successful navigation, or `false` otherwise.
     */
    navigate(qualifier: Qualifier | Empty<Qualifier>, extras?: WorkbenchNavigationExtras): Promise<boolean>;
    private issueViewIntent;
    private updateViewParams;
    private isSelfNavigation;
}
/**
 * Options to control the navigation.
 *
 * @category Router
 * @category View
 */
interface WorkbenchNavigationExtras {
    /**
     * Passes data to the view.
     *
     * The view can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: Map<string, any> | Dictionary;
    /**
     * Instructs the workbench router how to handle params in self-navigation.
     *
     * Self-navigation allows the microfrontend to update its parameters, restoring updated parameters when the page reloads.
     * Setting a `paramsHandling` strategy has no effect on navigations other than self-navigation. A self-navigation is
     * initiated by passing an empty qualifier.
     *
     * One of:
     * * `replace`: Replaces current parameters (default).
     * * `merge`:   Merges new parameters with current parameters, with new parameters of equal name overwriting existing parameters.
     *              A parameter can be removed by passing `undefined` as its value.
     */
    paramsHandling?: 'merge' | 'replace';
    /**
     * Controls where to open the view. Defaults to `auto`.
     *
     * One of:
     * - 'auto':   Navigates existing views that match the qualifier and required params, or opens a new view otherwise. Optional parameters do not affect view resolution.
     * - 'blank':  Opens a new view and navigates it.
     * - <viewId>: Navigates the specified view. If already opened, replaces it, or opens a new view otherwise.
     */
    target?: string | 'blank' | 'auto';
    /**
     * Controls which part to navigate views in.
     *
     * If target is `blank`, opens the view in the specified part.
     * If target is `auto`, navigates matching views in the specified part, or opens a new view in that part otherwise.
     *
     * If the specified part is not in the layout, opens the view in the active part, with the active part of the main area taking precedence.
     */
    partId?: string;
    /**
     * Instructs the router to activate the view. Defaults to `true`.
     */
    activate?: boolean;
    /**
     * Closes views that match the specified qualifier and required parameters. Optional parameters do not affect view resolution.
     *
     * The parameters support the asterisk wildcard value (`*`) to match views with any value for a parameter.
     *
     * Only views for which the application has an intention can be closed.
     */
    close?: boolean;
    /**
     * Specifies where to insert the view into the tab bar. Has no effect if navigating an existing view. Defaults to after the active view.
     */
    position?: number | 'start' | 'end' | 'before-active-view' | 'after-active-view';
    /**
     * Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.
     */
    cssClass?: string | string[];
}
/**
 * Command object for instructing the Workbench Router to update view params in self-navigation.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
interface ɵViewParamsUpdateCommand {
    /**
     * @see WorkbenchNavigationExtras#params
     */
    params: Dictionary;
    /**
     * @see WorkbenchNavigationExtras#paramsHandling
     */
    paramsHandling?: 'merge' | 'replace';
}
/**
 * Named parameters used in microfrontend routes.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
declare enum ɵMicrofrontendRouteParams {
    /**
     * Named path segment in the microfrontend route representing the view capability for which to embed its microfrontend.
     */
    ɵVIEW_CAPABILITY_ID = "\u0275ViewCapabilityId"
}

/**
 * Built-in workbench capabilities.
 */
declare enum WorkbenchCapabilities {
    /**
     * Contributes a microfrontend for display in workbench view.
     *
     * A view is a visual workbench element for displaying content stacked or side-by-side.
     */
    View = "view",
    /**
     * Contributes a perspective to the workbench.
     *
     * A perspective is a named arrangement of views. Different perspectives provide a different perspective on the application.
     */
    Perspective = "perspective",
    /**
     * Contributes a microfrontend for display in workbench popup.
     *
     * A popup is a visual workbench component for displaying content above other content.
     */
    Popup = "popup",
    /**
     * Contributes a microfrontend for display in workbench dialog.
     *
     * A dialog is a visual element for focused interaction with the user, such as prompting the user for input or confirming actions.
     */
    Dialog = "dialog",
    /**
     * Contributes a message box in the host app.
     *
     * A message box is a standardized dialog for presenting a message to the user, such as an info, warning or alert,
     * or for prompting the user for confirmation.
     */
    MessageBox = "messagebox",
    /**
     * Contributes a notification in the host app.
     *
     * A notification appears in the upper-right corner and disappears automatically after a few seconds.
     * It informs the user of a system event, e.g., that a task has been completed or an error has occurred.
     */
    Notification = "notification"
}

/**
 * Represents a microfrontend for display in a workbench view.
 *
 * A view is a visual workbench element for displaying content stacked or side-by-side.
 *
 * The microfrontend can inject the {@link WorkbenchView} handle to interact with the view, such as setting the title, reading
 * parameters, or closing it.
 *
 * @category View
 * @see WorkbenchView
 * @see WorkbenchRouter
 */
interface WorkbenchViewCapability extends Capability {
    /**
     * @inheritDoc
     */
    type: WorkbenchCapabilities.View;
    /**
     * Qualifies this view. The qualifier is required for views.
     *
     * @inheritDoc
     */
    qualifier: Qualifier;
    /**
     * Specifies parameters required by the view.
     *
     * Parameters are available in the path and title for placeholder substitution, or can be read in the microfrontend by injecting the {@link WorkbenchView} handle.
     *
     * @inheritDoc
     */
    params?: ViewParamDefinition[];
    /**
     * @inheritDoc
     */
    properties: {
        /**
         * Specifies the path to the microfrontend.
         *
         * The path is relative to the base URL specified in the application manifest. If the
         * application does not declare a base URL, it is relative to the origin of the manifest file.
         *
         * The path supports placeholders that will be replaced with parameter values. A placeholder
         * starts with a colon (`:`) followed by the parameter name.
         *
         * Usage:
         * ```json
         * {
         *   "type": "view",
         *   "qualifier": {"entity": "product"},
         *   "params": [
         *     {"name": "id", "required":  true, "description": "Identifies the product."}
         *   ],
         *   "properties": {
         *     "path": "product/:id",
         *     ...
         *   }
         * }
         * ```
         */
        path: string;
        /**
         * Specifies the title of this view.
         *
         * The title supports placeholders that will be replaced with parameter values. A placeholder starts with a colon (`:`) followed by the parameter name.
         * The title can also be set in the microfrontend via {@link WorkbenchView} handle.
         */
        title?: string;
        /**
         * Specifies the subtitle of this view.
         *
         * The heading supports placeholders that will be replaced with parameter values. A placeholder starts with a colon (`:`) followed by the parameter name.
         * The heading can also be set in the microfrontend via {@link WorkbenchView} handle.
         */
        heading?: string;
        /**
         * Specifies if to display a close button in the view tab. Defaults to `true`.
         */
        closable?: boolean;
        /**
         * Instructs the workbench to show a splash, such as a skeleton or loading indicator, until the view microfrontend signals readiness.
         *
         * By default, the workbench shows a loading indicator. A custom splash can be configured in the workbench host application.
         *
         * @see WorkbenchView.signalReady
         */
        showSplash?: boolean;
        /**
         * Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.
         */
        cssClass?: string | string[];
        /**
         * Arbitrary metadata associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Describes a parameter to be passed along with a view intent.
 *
 * @category View
 * @inheritDoc
 */
interface ViewParamDefinition extends ParamDefinition {
    /**
     * Controls how the workbench router should pass this parameter to the workbench view.
     *
     * By default, parameters are passed via the workbench URL as matrix parameters.
     * Marking a parameter as "transient" instructs the router to pass it via navigational state, useful for large objects.
     *
     * Transient parameters are not persistent, they are only added to the browser's session history to support back/forward browser navigation.
     * Microfrontends must be able to restore state without relying on transient parameters.
     */
    transient?: boolean;
    /**
     * @inheritDoc
     */
    [property: string]: any;
}

/**
 * A view is a visual workbench element for displaying content stacked or side-by-side in the workbench layout.
 *
 * Users can drag views from one part to another, even across windows, or place them side-by-side, horizontally and vertically.
 *
 * The view microfrontend can inject this handle to interact with the view.
 *
 * @category View
 * @see WorkbenchViewCapability
 * @see WorkbenchRouter
 */
declare abstract class WorkbenchView {
    /**
     * Represents the identity of this view.
     */
    abstract readonly id: ViewId;
    /**
     * Signals readiness, notifying the workbench that this view has completed initialization.
     *
     * If `showSplash` is set to `true` on the view capability, the workbench displays a splash until the view microfrontend signals readiness.
     *
     * @see WorkbenchViewCapability.properties.showSplash
     */
    abstract signalReady(): void;
    /**
     * Provides the capability of the microfrontend loaded into the view.
     *
     * Upon subscription, emits the microfrontend's capability, and then emits continuously when navigating to a different microfrontend
     * of the same application. It completes when navigating to a microfrontend of another application.
     */
    abstract readonly capability$: Observable<WorkbenchViewCapability>;
    /**
     * Provides the parameters of the microfrontend loaded into the view.
     *
     * Upon subscription, emits the microfrontend's parameters, and then emits continuously when the parameters change.
     * The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend
     * of the same application.
     */
    abstract readonly params$: Observable<ReadonlyMap<string, any>>;
    /**
     * The current snapshot of this view.
     */
    abstract readonly snapshot: ViewSnapshot;
    /**
     * Indicates whether this view is active.
     *
     * Upon subscription, emits the active state of this view, and then emits continuously when it changes.
     * The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend
     * of the same application.
     */
    abstract readonly active$: Observable<boolean>;
    /**
     * Provides the identity of the part that contains this view.
     *
     * Upon subscription, emits the identity of this view's part, and then emits continuously when it changes.
     * The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend
     * of the same application.
     */
    abstract readonly partId$: Observable<string>;
    /**
     * Sets the title to be displayed in the view tab.
     */
    abstract setTitle(title: string | Observable<string>): void;
    /**
     * Sets the subtitle to be displayed in the view tab.
     */
    abstract setHeading(heading: string | Observable<string>): void;
    /**
     * Sets whether this view is dirty or pristine. When navigating to another microfrontend, the view's dirty state is set to pristine.
     *
     * You can provide the dirty/pristine state either as a boolean or as Observable. If you pass an Observable, it will be unsubscribed when
     * navigating to another microfrontend, whether from the same app or a different one.
     *
     * If not passing an argument, the view is marked as dirty. To mark it as pristine, you need to pass `false`.
     */
    abstract markDirty(dirty?: boolean | Observable<boolean>): void;
    /**
     * Controls whether the user should be allowed to close this workbench view.
     *
     * You can provide either a boolean or Observable. If you pass an Observable, it will be unsubscribed when navigating to another microfrontend,
     * whether from the same app or a different one.
     */
    abstract setClosable(closable: boolean | Observable<boolean>): void;
    /**
     * Initiates the closing of this workbench view.
     */
    abstract close(): void;
    /**
     * Registers a guard to confirm closing the view, replacing any previous guard.
     *
     * Example:
     * ```ts
     * Beans.get(WorkbenchView).canClose(async () => {
     *   const action = await Beans.get(WorkbenchMessageBoxService).open('Do you want to save changes?', {
     *     actions: {
     *       yes: 'Yes',
     *       no: 'No',
     *       cancel: 'Cancel'
     *     }
     *   });
     *
     *   switch (action) {
     *     case 'yes':
     *       // Store changes ...
     *       return true;
     *     case 'no':
     *       return true;
     *     default:
     *       return false;
     *   }
     * });
     * ```
     *
     * @param canClose - Callback to confirm closing the view.
     * @returns Reference to the `CanClose` guard, which can be used to unregister the guard.
     */
    abstract canClose(canClose: CanCloseFn): CanCloseRef;
}
/**
 * The signature of a function to confirm closing a view., e.g., if dirty.
 */
type CanCloseFn = () => Observable<boolean> | Promise<boolean> | boolean;
/**
 * Reference to the `CanClose` guard registered on a view.
 */
interface CanCloseRef {
    /**
     * Removes the `CanClose` guard from the view.
     *
     * Has no effect if another guard was registered in the meantime.
     */
    dispose(): void;
}
/**
 * Provides information about a view displayed at a particular moment in time.
 *
 * @category View
 */
interface ViewSnapshot {
    /**
     * Parameters of the microfrontend loaded into the view.
     */
    params: ReadonlyMap<string, any>;
    /**
     * The identity of the part that contains the view.
     */
    partId: string;
}
/**
 * Format of a view identifier.
 *
 * Each view is assigned a unique identifier (e.g., `view.1`, `view.2`, etc.).
 *
 * @category View
 */
type ViewId = `view.${number}`;

declare class ɵWorkbenchView implements WorkbenchView, PreDestroy {
    id: ViewId;
    private _propertyChange$;
    private _destroy$;
    /**
     * Observable that emits when the application loaded into the current view receives an unloading event,
     * i.e., is just about to be replaced by a microfrontend of another application.
     */
    private _beforeUnload$;
    /**
     * Observable that emits before navigating to a different microfrontend of the same app.
     */
    private _beforeInAppNavigation$;
    private _canCloseFn;
    private _canCloseSubscription;
    active$: Observable<boolean>;
    partId$: Observable<string>;
    params$: Observable<ReadonlyMap<string, any>>;
    capability$: Observable<WorkbenchViewCapability>;
    whenProperties: Promise<void>;
    snapshot: ViewSnapshot;
    constructor(id: ViewId);
    /** @inheritDoc */
    signalReady(): void;
    /** @inheritDoc */
    setTitle(title: string | Observable<string>): void;
    /** @inheritDoc */
    setHeading(heading: string | Observable<string>): void;
    /** @inheritDoc */
    markDirty(dirty: undefined | boolean | Observable<boolean>): void;
    /** @inheritDoc */
    setClosable(closable: boolean | Observable<boolean>): void;
    /** @inheritDoc */
    close(): void;
    /** @inheritDoc */
    canClose(canClose: CanCloseFn): CanCloseRef;
    preDestroy(): void;
}
/**
 * Context key to retrieve the view ID for microfrontends embedded in the context of a workbench view.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 * @see {@link ContextService}
 */
declare const ɵVIEW_ID_CONTEXT_KEY = "\u0275workbench.view.id";

/**
 * Defines command endpoints for the communication between SCION Workbench and SCION Workbench Client.
 *
 * @docs-private Not public API, intended for internal use only.
 */
declare const ɵWorkbenchCommands: {
    /**
     * Computes the topic via which the title of a workbench view tab can be set.
     */
    readonly viewTitleTopic: (viewId: ViewId | ":viewId") => string;
    /**
     * Computes the topic via which the heading of a workbench view tab can be set.
     */
    readonly viewHeadingTopic: (viewId: ViewId | ":viewId") => string;
    /**
     * Computes the topic via which a view tab can be marked dirty or pristine.
     */
    readonly viewDirtyTopic: (viewId: ViewId | ":viewId") => string;
    /**
     * Computes the topic via which a view tab can be made closable.
     */
    readonly viewClosableTopic: (viewId: ViewId | ":viewId") => string;
    /**
     * Computes the topic via which a view can be closed.
     */
    readonly viewCloseTopic: (viewId: ViewId | ":viewId") => string;
    /**
     * Computes the topic to notify the active state of a view.
     *
     * The active state is published as a retained message.
     */
    readonly viewActiveTopic: (viewId: ViewId) => string;
    /**
     * Computes the topic to notify the part of a view.
     *
     * The part identity is published as a retained message.
     */
    readonly viewPartIdTopic: (viewId: ViewId) => string;
    /**
     * Computes the topic to request closing confirmation of a view.
     *
     * When closing a view and if the microfrontend has subscribed to this topic, the workbench requests closing confirmation
     * via this topic. By sending a `true` reply, the workbench continues with closing the view, by sending a `false` reply,
     * closing is prevented.
     */
    readonly canCloseTopic: (viewId: ViewId) => string;
    /**
     * Computes the topic for signaling that a microfrontend is about to be replaced by a microfrontend of another app.
     */
    readonly viewUnloadingTopic: (viewId: ViewId) => string;
    /**
     * Computes the topic for updating params of a microfrontend view.
     */
    readonly viewParamsUpdateTopic: (viewId: ViewId, viewCapabilityId: string) => string;
    /**
     * Computes the topic for providing params to a view microfrontend.
     *
     * Params include the {@link ɵMicrofrontendRouteParams#ɵVIEW_CAPABILITY_ID capability id}, params as passed in {@link WorkbenchNavigationExtras.params},
     * and the view qualifier.
     *
     * Params are published as a retained message.
     */
    readonly viewParamsTopic: (viewId: ViewId) => string;
    /**
     * Computes the topic for observing the popup origin.
     */
    readonly popupOriginTopic: (popupId: string) => string;
    /**
     * Computes the topic via which a popup can be closed.
     */
    readonly popupCloseTopic: (popupId: string) => string;
    /**
     * Computes the topic via which to set a result
     */
    readonly popupResultTopic: (popupId: string) => string;
    /**
     * Computes the topic via which the title of a dialog can be set.
     */
    readonly dialogTitleTopic: (dialogId: string) => string;
    /**
     * Computes the topic via which a dialog can be closed.
     */
    readonly dialogCloseTopic: (dialogId: string) => string;
};

/**
 * Represents a point on the page or view, optionally with a dimension, where a workbench popup should be attached.
 *
 * @category Popup
 */
type PopupOrigin = (Point | TopLeftPoint | TopRightPoint | BottomLeftPoint | BottomRightPoint) & {
    width?: number;
    height?: number;
};
/**
 * Coordinate relative to the "x/y" corner of the view or page viewport.
 *
 * @category Popup
 */
interface Point {
    x: number;
    y: number;
}
/**
 * Coordinate relative to the "top/left" corner of the view or page viewport.
 *
 * This is equivalent to passing a "x/y" coordinate as {@link Point}.
 *
 * @category Popup
 */
interface TopLeftPoint {
    top: number;
    left: number;
}
/**
 * Coordinate relative to the "top/right" corner of the view or page viewport.
 *
 * @category Popup
 */
interface TopRightPoint {
    top: number;
    right: number;
}
/**
 * Coordinate relative to the "bottom/left" corner of the view or page viewport.
 *
 * @category Popup
 */
interface BottomLeftPoint {
    bottom: number;
    left: number;
}
/**
 * Coordinate relative to the "bottom/right" corner of the view or page viewport.
 *
 * @category Popup
 */
interface BottomRightPoint {
    bottom: number;
    right: number;
}

/**
 * Configures the popup to display a microfrontend in a workbench popup using {@link WorkbenchPopupService}.
 *
 * @category Popup
 */
interface WorkbenchPopupConfig {
    /**
     * Controls where to open the popup.
     *
     * Can be an HTML element or coordinates:
     * - Using an element: The popup opens and sticks to the element.
     * - Using coordinates: The popup opens and sticks relative to the view or page bounds.
     *
     * Supported coordinate pairs:
     * - x/y: Relative to the top/left corner of the view or page.
     * - top/left: Same as x/y.
     * - top/right: Relative to the top/right corner.
     * - bottom/left: Relative to the bottom/left corner.
     * - bottom/right: Relative to the bottom/right corner.
     *
     * Coordinates can be updated using an Observable. The popup displays when the Observable emits the first coordinate.
     */
    anchor: Element | PopupOrigin | Observable<PopupOrigin>;
    /**
     * Passes data to the popup.
     *
     * The popup can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: Map<string, any> | Dictionary;
    /**
     * Hint where to align the popup relative to the popup anchor, unless there is not enough space available in that area. By default,
     * if not specified, the popup opens north of the anchor.
     */
    align?: 'east' | 'west' | 'north' | 'south';
    /**
     * Controls when to close the popup.
     */
    closeStrategy?: CloseStrategy;
    /**
     * Specifies CSS class(es) to add to the popup, e.g., to locate the popup in tests.
     */
    cssClass?: string | string[];
    /**
     * Specifies the context in which to open the popup.
     */
    context?: {
        /**
         * Specifies the view the popup belongs to.
         *
         * Binds the popup to the lifecycle of a view so that it displays only if the view is active and closes when the view is closed.
         *
         * By default, if opening the popup in the context of a view, that view is used as the popup's contextual view.
         * If you set the view id to `null`, the popup will open without referring to the contextual view.
         */
        viewId?: ViewId | null;
    };
}
/**
 * Specifies when to close the popup.
 *
 * @category Popup
 */
interface CloseStrategy {
    /**
     * Controls if to close the popup on focus loss, returning the result set via {@link Popup#setResult} to the popup opener.
     * Defaults to `true`.
     */
    onFocusLost?: boolean;
    /**
     * Controls if to close the popup when pressing escape. Defaults to `true`.
     * No return value will be passed to the popup opener.
     */
    onEscape?: boolean;
}

/**
 * Command object for instructing the Workbench to open the microfrontend of given popup capability in a popup.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
interface ɵWorkbenchPopupCommand {
    popupId: string;
    align?: 'east' | 'west' | 'north' | 'south';
    closeStrategy?: CloseStrategy;
    cssClass?: string | string[];
    context?: {
        viewId?: ViewId | null;
    };
}

/**
 * Displays a microfrontend in a popup.
 *
 * A popup is a visual workbench component for displaying content above other content. It is positioned relative to an anchor and
 * moves when the anchor moves. Unlike a dialog, the popup closes on focus loss.
 *
 * A microfrontend provided as a `popup` capability can be opened in a popup. The qualifier differentiates between different
 * popup capabilities. An application can open the public popup capabilities of other applications if it manifests a respective
 * intention.
 *
 * @category Popup
 * @see WorkbenchPopupCapability
 */
declare class WorkbenchPopupService {
    /**
     * Displays a microfrontend in a workbench popup based on the given qualifier.
     *
     * The qualifier identifies the microfrontend to display in the popup.
     *
     * The anchor is used to position the popup based on its preferred alignment:
     * - Using an element: The popup opens and sticks to the element.
     * - Using coordinates: The popup opens and sticks relative to the view or page bounds.
     *
     * If the popup is opened within a view, it only displays if the view is active and closes when the view is closed.
     *
     * By default, the popup closes on focus loss or when pressing the escape key.
     *
     * Pass data to the popup using parameters. Only declared parameters are allowed. Refer to the capability documentation for details.
     *
     * @param  qualifier - Identifies the popup capability that provides the microfrontend for display as popup.
     * @param  config - Controls popup behavior.
     * @returns Promise that resolves to the popup result, if any, or that rejects if the popup was closed with an error or couldn't be opened,
     *          e.g., because of missing the intention or because no `popup` capability matching the qualifier and visible to the application
     *          was found.
     */
    open<T>(qualifier: Qualifier, config: WorkbenchPopupConfig): Promise<T | undefined>;
    /**
     * Observes the position of the popup anchor.
     *
     * The Observable emits the anchor's initial position, and each time its position changes.
     * The Observable never completes.
     */
    private observePopupOrigin$;
}

/**
 * Represents a microfrontend for display in a workbench popup.
 *
 * A popup is a visual workbench component for displaying content above other content.
 *
 * Unlike views, popups are not part of the persistent workbench navigation, meaning that popups do not survive a page reload.
 *
 * @category Popup
 */
interface WorkbenchPopupCapability extends Capability {
    type: WorkbenchCapabilities.Popup;
    /**
     * Qualifies this popup. The qualifier is required for popups.
     */
    qualifier: Qualifier;
    properties: {
        /**
         * Specifies the path of the microfrontend to be opened when navigating to this popup capability.
         *
         * The path is relative to the base URL, as specified in the application manifest. If the
         * application does not declare a base URL, it is relative to the origin of the manifest file.
         *
         * In the path, you can reference qualifier and parameter values in the form of named parameters.
         * Named parameters begin with a colon (`:`) followed by the parameter or qualifier name, and are allowed in path segments, query parameters, matrix parameters
         * and the fragment part. The popup router will substitute named parameters in the URL accordingly.
         *
         * In addition to using qualifier and parameter values as named parameters in the URL, params are available in the microfrontend via {@link WorkbenchPopup.params} object.
         *
         * #### Usage of named parameters in the path:
         * ```json
         * {
         *   "type": "popup",
         *   "qualifier": {"entity": "product"},
         *   "params": [
         *     {"name": "id", "required":  true, "description": "Identifies the product."}
         *   ],
         *   "properties": {
         *     "path": "product/:id",
         *     ...
         *   }
         * }
         * ```
         *
         * #### Path parameter example:
         * segment/:param1/segment/:param2
         *
         * #### Matrix parameter example:
         * segment/segment;matrixParam1=:param1;matrixParam2=:param2
         *
         * #### Query parameter example:
         * segment/segment?queryParam1=:param1&queryParam2=:param2
         */
        path: string;
        /**
         * Specifies the preferred popup size.
         *
         * If not set, the popup will adjust its size to the content size reported by the embedded content using {@link @scion/microfrontend-platform!PreferredSizeService}.
         * Note that the microfrontend may take some time to load, causing the popup to flicker when opened. Therefore, for fixed-sized popups,
         * consider declaring the popup size in the popup capability.
         */
        size?: PopupSize;
        /**
         * Instructs the workbench to show a splash, such as a skeleton or loading indicator, until the popup microfrontend signals readiness.
         *
         * By default, the workbench shows a loading indicator. A custom splash can be configured in the workbench host application.
         *
         * @see WorkbenchPopup.signalReady
         */
        showSplash?: boolean;
        /**
         * Specifies CSS class(es) to add to the popup, e.g., to locate the popup in tests.
         */
        cssClass?: string | string[];
        /**
         * Arbitrary metadata associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Represents the preferred popup size.
 */
interface PopupSize {
    /**
     * Specifies the min-height of the popup.
     */
    minHeight?: string;
    /**
     * Specifies the height of the popup.
     */
    height?: string;
    /**
     * Specifies the max-height of the popup.
     */
    maxHeight?: string;
    /**
     * Specifies the min-width of the popup.
     */
    minWidth?: string;
    /**
     * Specifies the width of the popup.
     */
    width?: string;
    /**
     * Specifies the max-width of the popup.
     */
    maxWidth?: string;
}

/**
 * Information about the context in which a popup was opened.
 *
 * @category Popup
 */
interface WorkbenchPopupReferrer {
    /**
     * Identity of the view if opened in the context of a view.
     */
    viewId?: ViewId;
    /**
     * Identity of the view capability if opened in the context of a view microfrontend.
     */
    viewCapabilityId?: string;
}

/**
 * Context when displaying a microfrontend in a popup.
 *
 * This object can be obtained from the {@link ContextService} using the name {@link ɵPOPUP_CONTEXT}.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
interface ɵPopupContext {
    popupId: string;
    params: Map<string, any>;
    capability: WorkbenchPopupCapability;
    closeOnFocusLost: boolean;
    referrer: WorkbenchPopupReferrer;
}
/**
 * Key for obtaining the current popup context using {@link ContextService}.
 *
 * The popup context is only available to microfrontends loaded in a workbench popup.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 * @see {@link ContextService}
 * @see {@link ɵPopupContext}
 */
declare const ɵPOPUP_CONTEXT = "\u0275workbench.popup";

/**
 * A popup is a visual workbench component for displaying content above other content.
 *
 * If a microfrontend lives in the context of a workbench popup, regardless of its embedding level, it can inject an instance
 * of this class to interact with the workbench popup, such as reading passed parameters or closing the popup.
 *
 * #### Preferred Size
 * You can report preferred popup size using {@link @scion/microfrontend-platform!PreferredSizeService}. Typically, you would
 * subscribe to size changes of the microfrontend's primary content and report it. As a convenience, {@link @scion/microfrontend-platform!PreferredSizeService}
 * provides API to pass an element for automatic dimension monitoring. If your content can grow and shrink, e.g., if using expandable
 * panels, consider positioning primary content out of the document flow, that is, setting its position to `absolute`. This way,
 * you give it infinite space so that it can always be rendered at its preferred size.
 *
 * ```typescript
 * Beans.get(PreferredSizeService).fromDimension(<HTMLElement>);
 * ```
 *
 * Note that the microfrontend may take some time to load, causing the popup to flicker when opened. Therefore, for fixed-sized
 * popups, consider declaring the popup size in the popup capability.
 *
 * @category Popup
 */
declare abstract class WorkbenchPopup<R = unknown> {
    /**
     * Capability that represents the microfrontend loaded into this workbench popup.
     */
    abstract readonly capability: WorkbenchPopupCapability;
    /**
     * Signals readiness, notifying the workbench that this popup has completed initialization.
     *
     * If `showSplash` is set to `true` on the popup capability, the workbench displays a splash until the popup microfrontend signals readiness.
     *
     * @see WorkbenchPopupCapability.properties.showSplash
     */
    abstract signalReady(): void;
    /**
     * Provides information about the context in which this popup was opened.
     */
    abstract readonly referrer: WorkbenchPopupReferrer;
    /**
     * Parameters including qualifier entries as passed for navigation by the popup opener.
     */
    abstract readonly params: Map<string, any>;
    /**
     * Sets a result that will be passed to the popup opener when the popup is closed on focus loss {@link CloseStrategy#onFocusLost}.
     */
    abstract setResult(result?: R): void;
    /**
     * Closes the popup. Optionally, pass a result or an error to the popup opener.
     */
    abstract close(result?: R | Error): void;
}
/**
 * Message headers to interact with the workbench popup.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
declare enum ɵWorkbenchPopupMessageHeaders {
    CLOSE_WITH_ERROR = "\u0275WORKBENCH-POPUP:CLOSE_WITH_ERROR"
}

/**
 * Represents a microfrontend for display in a workbench dialog.
 *
 * A dialog is a visual element for focused interaction with the user, such as prompting the user for input or confirming actions.
 * The user can move or resize a dialog.
 *
 * Displayed on top of other content, a dialog blocks interaction with other parts of the application. Multiple dialogs are stacked,
 * and only the topmost dialog in each modality stack can be interacted with.
 *
 * The microfrontend can inject the {@link WorkbenchDialog} handle to interact with the dialog, such as setting the title, reading
 * parameters, or closing it.
 *
 * If provided by the workbench host application, the dialog has a footer and resizes to fit its content. See the documentation of
 * `WorkbenchDialogService` in `@scion/workbench` for more information on adding actions to the footer.
 *
 * Dialogs from other applications must specify their size using {@link WorkbenchDialogCapability.properties.size} and add
 * the footer in the microfrontend.
 *
 * @category Dialog
 * @see WorkbenchDialog
 * @see WorkbenchDialogService
 */
interface WorkbenchDialogCapability extends Capability {
    /**
     * @inheritDoc
     */
    type: WorkbenchCapabilities.Dialog;
    /**
     * Qualifies this dialog. The qualifier is required for dialogs.
     *
     * @inheritDoc
     */
    qualifier: Qualifier;
    /**
     * Specifies parameters required by the dialog.
     *
     * Parameters are available in the path and title for placeholder substitution, or can be read in the microfrontend by injecting the {@link WorkbenchDialog} handle.
     *
     * @inheritDoc
     */
    params?: ParamDefinition[];
    /**
     * @inheritDoc
     */
    properties: {
        /**
         * Specifies the path to the microfrontend.
         *
         * The path is relative to the base URL specified in the application manifest. If the
         * application does not declare a base URL, it is relative to the origin of the manifest file.
         *
         * The path supports placeholders that will be replaced with parameter values. A placeholder
         * starts with a colon (`:`) followed by the parameter name.
         *
         * Usage:
         * ```json
         * {
         *   "type": "dialog",
         *   "qualifier": {"entity": "product"},
         *   "params": [
         *     {"name": "id", "required":  true, "description": "Identifies the product."}
         *   ],
         *   "properties": {
         *     "path": "product/:id",
         *     ...
         *   }
         * }
         * ```
         */
        path: string;
        /**
         * Specifies the size of this dialog, required if this dialog is provided by an application other than the workbench host application.
         */
        size?: WorkbenchDialogSize;
        /**
         * Specifies the title of this dialog.
         *
         * The title supports placeholders that will be replaced with parameter values. A placeholder starts with a colon (`:`) followed by the parameter name.
         * The title can also be set in the microfrontend via {@link WorkbenchDialog} handle.
         */
        title?: string;
        /**
         * Specifies if to display a close button in the dialog header. Defaults to `true`.
         */
        closable?: boolean;
        /**
         * Specifies if the user can resize the dialog. Defaults to `true`.
         */
        resizable?: boolean;
        /**
         * Controls if to apply a padding to the content of the dialog.
         *
         * By default, dialogs provided by the workbench host application have a padding, others do not.
         */
        padding?: boolean;
        /**
         * Instructs the workbench to show a splash, such as a skeleton or loading indicator, until the dialog microfrontend signals readiness.
         *
         * By default, the workbench shows a loading indicator. A custom splash can be configured in the workbench host application.
         *
         * @see WorkbenchDialog.signalReady
         */
        showSplash?: boolean;
        /**
         * Specifies CSS class(es) to add to the dialog, e.g., to locate the dialog in tests.
         */
        cssClass?: string | string[];
        /**
         * Arbitrary metadata associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Specifies the dialog size.
 */
interface WorkbenchDialogSize {
    /**
     * Specifies the height of the dialog, required if this dialog is provided by an application other than the workbench host application.
     */
    height?: string;
    /**
     * Specifies the width of the dialog, required if this dialog is provided by an application other than the workbench host application.
     */
    width?: string;
    /**
     * Specifies the minimum height of the dialog.
     */
    minHeight?: string;
    /**
     * Specifies the maximum height of the dialog.
     */
    maxHeight?: string;
    /**
     * Specifies the minimum width of the dialog.
     */
    minWidth?: string;
    /**
     * Specifies the maximum width of the dialog.
     */
    maxWidth?: string;
}

/**
 * Handle to interact with a dialog opened via {@link WorkbenchDialogService}.
 *
 * The dialog microfrontend can inject this handle to interact with the dialog, such as setting the title,
 * reading parameters, or closing it.
 *
 * @category Dialog
 * @see WorkbenchDialogCapability
 * @see WorkbenchDialogService
 */
declare abstract class WorkbenchDialog<R = unknown> {
    /**
     * Capability of the microfrontend loaded into this dialog.
     */
    abstract readonly capability: WorkbenchDialogCapability;
    /**
     * Parameters as passed by the dialog opener.
     */
    abstract readonly params: Map<string, unknown>;
    /**
     * Sets the title of the dialog.
     */
    abstract setTitle(title: string | Observable<string>): void;
    /**
     * Signals readiness, notifying the workbench that this dialog has completed initialization.
     *
     * If `showSplash` is set to `true` on the dialog capability, the workbench displays a splash until the dialog microfrontend signals readiness.
     *
     * @see WorkbenchDialogCapability.properties.showSplash
     */
    abstract signalReady(): void;
    /**
     * Closes the dialog. Optionally, pass a result or an error to the dialog opener.
     */
    abstract close(result?: R | Error): void;
}

/**
 * Configures the dialog to display a microfrontend in a workbench dialog using {@link WorkbenchDialogService}.
 *
 * @category Dialog
 */
interface WorkbenchDialogOptions {
    /**
     * Passes data to the dialog.
     *
     * The dialog can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: Map<string, unknown> | {
        [param: string]: unknown;
    };
    /**
     * Controls which area of the application to block by the dialog.
     *
     * - **Application-modal:**
     *   Use to block the workbench, or the browser's viewport if configured in the workbench host application.
     *
     * - **View-modal:**
     *   Use to block only the contextual view of the dialog, allowing the user to interact with other views.
     *   This is the default if opening the dialog in the context of a view.
     */
    modality?: 'application' | 'view';
    /**
     * Specifies the context in which to open the dialog.
     */
    context?: {
        /**
         * Controls which view to block when opening a dialog view-modal.
         *
         * By default, if opening the dialog in the context of a view, that view is used as the contextual view.
         */
        viewId?: ViewId;
    };
    /**
     * Controls whether to animate the opening of the dialog. Defaults is `false`.
     */
    animate?: boolean;
    /**
     * Specifies CSS class(es) to add to the dialog, e.g., to locate the dialog in tests.
     */
    cssClass?: string | string[];
}

/**
 * Displays a microfrontend in a modal dialog.
 *
 * A dialog is a visual element for focused interaction with the user, such as prompting the user for input or confirming actions.
 * The user can move or resize a dialog.
 *
 * A microfrontend provided as a `dialog` capability can be opened in a dialog. The qualifier differentiates between different
 * dialog capabilities. An application can open the public dialog capabilities of other applications if it manifests a respective
 * intention.
 *
 * Displayed on top of other content, a dialog blocks interaction with other parts of the application. Multiple dialogs are stacked,
 * and only the topmost dialog in each modality stack can be interacted with.
 *
 * A dialog can be view-modal or application-modal. A view-modal dialog blocks only a specific view, allowing the user to interact
 * with other views. An application-modal dialog blocks the workbench, or the browser's viewport if configured in the workbench
 * host application.
 *
 * @category Dialog
 * @see WorkbenchDialogCapability
 */
declare abstract class WorkbenchDialogService {
    /**
     * Opens the microfrontend of a `dialog` capability in a workbench dialog based on the given qualifier and options.
     *
     * By default, the calling context determines the modality of the dialog. If the dialog is opened from a view, only this view is blocked.
     * To open the dialog with a different modality, specify the modality in {@link WorkbenchDialogOptions.modality}.
     *
     * @param qualifier - Identifies the dialog capability that provides the microfrontend to open in a dialog.
     * @param options - Controls how to open the dialog.
     * @returns Promise that resolves to the dialog result, if any, or that rejects if the dialog was closed with an error or couldn't be opened,
     *          e.g., because of missing the intention or because no `dialog` capability matching the qualifier and visible to the application
     *          was found.
     *
     * @see WorkbenchDialogCapability
     * @see WorkbenchDialog
     */
    abstract open<R>(qualifier: Qualifier, options?: WorkbenchDialogOptions): Promise<R | undefined>;
}

/**
 * @ignore
 * @docs-private Not public API, intended for internal use only.
 */
declare class ɵWorkbenchDialogService implements WorkbenchDialogService {
    /** @inheritDoc */
    open<R>(qualifier: Qualifier, options?: WorkbenchDialogOptions): Promise<R | undefined>;
}

/**
 * Context when displaying a microfrontend in a dialog.
 *
 * This object can be obtained from the {@link ContextService} using the name {@link ɵDIALOG_CONTEXT}.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
interface ɵDialogContext {
    dialogId: string;
    capability: WorkbenchDialogCapability;
    params: Map<string, unknown>;
}
/**
 * Key for obtaining the current dialog context using {@link ContextService}.
 *
 * The dialog context is only available to microfrontends loaded in a workbench dialog.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 * @see {@link ContextService}
 * @see {@link ɵDialogContext}
 */
declare const ɵDIALOG_CONTEXT = "\u0275workbench.dialog";

/**
 * Message headers to interact with the workbench dialog.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
declare enum ɵWorkbenchDialogMessageHeaders {
    CLOSE_WITH_ERROR = "\u0275WORKBENCH-DIALOG:CLOSE_WITH_ERROR"
}

/**
 * Represents a microfrontend for display in a workbench message box.
 *
 * A message box is a standardized dialog for presenting a message to the user, such as an info, warning or alert,
 * or for prompting the user for confirmation.
 *
 * Displayed on top of other content, a message box blocks interaction with other parts of the application. Multiple message boxes are stacked,
 * and only the topmost message box in each modality stack can be interacted with.
 *
 * The microfrontend can inject the {@link WorkbenchMessageBox} handle to interact with the message box, such as reading parameters or signaling readiness.
 *
 * The message box does not automatically adapt its size to the content. Refer to {@link WorkbenchMessageBoxCapability.properties.size} for more information.
 *
 * @category MessageBox
 * @see WorkbenchMessageBox
 * @see WorkbenchMessageBoxService
 */
interface WorkbenchMessageBoxCapability extends Capability {
    /**
     * @inheritDoc
     */
    type: WorkbenchCapabilities.MessageBox;
    /**
     * Qualifies this message box. The qualifier is required for message boxes.
     *
     * @inheritDoc
     */
    qualifier: Qualifier;
    /**
     * Specifies parameters required by the message box.
     *
     * Parameters are available in the path for placeholder substitution, or can be read in the microfrontend by injecting the {@link WorkbenchMessageBox} handle.
     *
     * @inheritDoc
     */
    params?: ParamDefinition[];
    /**
     * @inheritDoc
     */
    properties: {
        /**
         * Specifies the path to the microfrontend.
         *
         * The path is relative to the base URL specified in the application manifest. If the
         * application does not declare a base URL, it is relative to the origin of the manifest file.
         *
         * The path supports placeholders that will be replaced with parameter values. A placeholder
         * starts with a colon (`:`) followed by the parameter name.
         *
         * Usage:
         * ```json
         * {
         *   "type": "messagebox",
         *   "qualifier": {"entity": "product"},
         *   "params": [
         *     {"name": "id", "required":  true, "description": "Identifies the product."}
         *   ],
         *   "properties": {
         *     "path": "product/:id",
         *     ...
         *   }
         * }
         * ```
         */
        path: string;
        /**
         * Specifies the size of the message box.
         *
         * The message box does not automatically adapt its size to the content (only for message boxes provided by the host). Specify a fixed size in
         * the capability or report it from the microfrontend using {@link @scion/microfrontend-platform!PreferredSizeService}. If reporting it from the
         * microfrontend, consider also specifying the size in the capability to avoid flickering, as the microfrontend may take some time to load.
         */
        size?: WorkbenchMessageBoxSize;
        /**
         * Instructs the workbench to show a splash, such as a skeleton or loading indicator, until the message box microfrontend signals readiness.
         *
         * By default, the workbench shows a loading indicator. A custom splash can be configured in the workbench host application.
         * @see WorkbenchMessageBox.signalReady
         */
        showSplash?: boolean;
        /**
         * Specifies CSS class(es) to add to the message box, e.g., to locate the message box in tests.
         */
        cssClass?: string | string[];
        /**
         * Arbitrary metadata associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Specifies the preferred message box size.
 */
interface WorkbenchMessageBoxSize {
    /**
     * Specifies the min-height of the message box.
     */
    minHeight?: string;
    /**
     * Specifies the height of the message box.
     */
    height?: string;
    /**
     * Specifies the max-height of the message box.
     */
    maxHeight?: string;
    /**
     * Specifies the min-width of the message box.
     */
    minWidth?: string;
    /**
     * Specifies the width of the message box.
     */
    width?: string;
    /**
     * Specifies the max-width of the message box.
     */
    maxWidth?: string;
}
/**
 * Parameter name for the message displayed in the built-in text {@link WorkbenchMessageBoxCapability}.
 */
declare const eMESSAGE_BOX_MESSAGE_PARAM = "message";

/**
 * Controls the appearance and behavior of a message box.
 *
 * @category MessageBox
 */
interface WorkbenchMessageBoxOptions {
    /**
     * Specifies the title of the message box.
     */
    title?: string;
    /**
     * Defines buttons of the message box. If not set, an OK button is displayed by default.
     *
     * Each property in the object literal represents a button, with the property value used as the button label.
     * Clicking a button closes the message box and returns the property key to the message box opener.
     *
     * A button with the key 'cancel' is also assigned the Escape keystroke.
     *
     * **Example:**
     * ```ts
     * {
     *   yes: 'Yes',
     *   no: 'No',
     *   cancel: 'Cancel',
     * }
     * ```
     */
    actions?: {
        [key: string]: string;
    };
    /**
     * Specifies the severity of the message. Defaults to `info`.
     */
    severity?: 'info' | 'warn' | 'error';
    /**
     * Controls which area of the application to block by the message box.
     *
     * - **Application-modal:**
     *   Use to block the workbench, or the browser's viewport if configured in the workbench host application.
     *
     * - **View-modal:**
     *   Use to block only the contextual view of the message box, allowing the user to interact with other views.
     *   This is the default if opening the message box in the context of a view.
     */
    modality?: 'application' | 'view';
    /**
     * Specifies if the user can select text displayed in the message box. Defaults to `false`.
     */
    contentSelectable?: boolean;
    /**
     * Passes data to the message box.
     *
     * The message box can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: Map<string, unknown> | {
        [param: string]: unknown;
    };
    /**
     * Specifies CSS class(es) to add to the message box, e.g., to locate the message box in tests.
     */
    cssClass?: string | string[];
    /**
     * Specifies the context in which to open the message box.
     */
    context?: {
        /**
         * Allows controlling which view to block when opening a view-modal message box.
         *
         * By default, if opening the message box in the context of a view, that view is used as the contextual view.
         */
        viewId?: ViewId;
    };
}

/**
 * Displays a microfrontend in a message box.
 *
 * A message box is a standardized dialog for presenting a message to the user, such as an info, warning or alert,
 * or for prompting the user for confirmation.
 *
 * A microfrontend provided as a `messagebox` capability can be opened in a message box. The qualifier differentiates between different
 * message box capabilities. An application can open the public message box capabilities of other applications if it manifests a respective
 * intention.
 *
 * Displayed on top of other content, a message box blocks interaction with other parts of the application. Multiple message boxes are stacked,
 * and only the topmost message box in each modality stack can be interacted with.
 *
 * A message box can be view-modal or application-modal. A view-modal message box blocks only a specific view, allowing the user to interact
 * with other views. An application-modal message box blocks the workbench, or the browser's viewport if configured in the workbench
 * host application.
 *
 * @category MessageBox
 * @see WorkbenchMessageBoxCapability
 */
declare abstract class WorkbenchMessageBoxService {
    /**
     * Displays the specified message in a message box.
     *
     * By default, the calling context determines the modality of the message box. If the message box is opened from a view, only this view is blocked.
     * To open the message box with a different modality, specify the modality in {@link WorkbenchMessageBoxOptions.modality}.
     *
     * **This API requires the following intention: `{"type": "messagebox"}`**
     *
     * @param message - Specifies the text to display.
     * @param options - Controls the appearance and behavior of the message box.
     * @returns Promise that resolves to the key of the action button that the user clicked to close the message box,
     *          or that rejects if the message box couldn't be opened, e.g., because of missing the intention.
     */
    abstract open(message: string, options?: WorkbenchMessageBoxOptions): Promise<string>;
    /**
     * Opens the microfrontend of a `messagebox` capability in a workbench message box based on the given qualifier and options.
     *
     * By default, the calling context determines the modality of the message box. If the message box is opened from a view, only this view is blocked.
     * To open the message box with a different modality, specify the modality in {@link WorkbenchMessageBoxOptions.modality}.
     *
     * @param qualifier - Identifies the `messagebox` capability that provides the microfrontend to open in a message box.
     * @param options - Controls the appearance and behavior of the message box.
     * @returns Promise that resolves to the key of the action button that the user clicked to close the message box,
     *          or that rejects if the message box couldn't be opened, e.g., because of missing the intention or because no `messagebox`
     *          capability matching the qualifier and visible to the application was found.
     *
     * @see WorkbenchMessageBoxCapability
     * @see WorkbenchMessageBox
     */
    abstract open(qualifier: Qualifier, options?: WorkbenchMessageBoxOptions): Promise<string>;
}

/**
 * @ignore
 * @docs-private Not public API, intended for internal use only.
 */
declare class ɵWorkbenchMessageBoxService implements WorkbenchMessageBoxService {
    /** @inheritDoc */
    open(message: string | Qualifier, options?: WorkbenchMessageBoxOptions): Promise<string>;
}

/**
 * Handle to interact with a message box opened via {@link WorkbenchMessageBoxService}.
 *
 * The message box microfrontend can inject this handle to interact with the message box,
 * such as reading parameters or signaling readiness.
 *
 * @category MessageBox
 * @see WorkbenchMessageBoxCapability
 * @see WorkbenchMessageBoxService
 */
declare abstract class WorkbenchMessageBox {
    /**
     * Capability of the microfrontend loaded into this message box.
     */
    abstract readonly capability: WorkbenchMessageBoxCapability;
    /**
     * Parameters as passed by the message box opener.
     */
    abstract readonly params: Map<string, unknown>;
    /**
     * Signals readiness, notifying the workbench that this message box has completed initialization.
     *
     * If `showSplash` is set to `true` on the `messagebox` capability, the workbench displays a splash until the message box microfrontend signals readiness.
     *
     * @see WorkbenchMessageBoxCapability.properties.showSplash
     */
    abstract signalReady(): void;
}

/**
 * Information about the message box embedding a microfrontend.
 *
 * This object can be obtained from the {@link ContextService} using the name {@link ɵMESSAGE_BOX_CONTEXT}.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 */
interface ɵMessageBoxContext {
    capability: WorkbenchMessageBoxCapability;
    params: Map<string, unknown>;
}
/**
 * Key for obtaining the current message box context using {@link ContextService}.
 *
 * The message box context is only available to microfrontends loaded in a workbench message box.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 * @see {@link ContextService}
 * @see {@link ɵMessageBoxContext}
 */
declare const ɵMESSAGE_BOX_CONTEXT = "\u0275workbench.message-box";

/**
 * Represents the built-in notification for displaying a plain text message to the user.
 *
 * @category Notification
 */
interface WorkbenchNotificationCapability extends Capability {
    qualifier: Empty<Qualifier>;
    type: WorkbenchCapabilities.Notification;
}

/**
 * Configures the content and appearance of a notification presented to the user.
 *
 * A notification is a closable message that appears in the upper-right corner and disappears automatically after a few seconds.
 * It informs the user of a system event, e.g., that a task has been completed or an error has occurred.
 *
 * Multiple notifications are stacked vertically. Notifications can be grouped. For each group, only the last notification is
 * displayed at any given time.
 *
 * @category Notification
 */
interface WorkbenchNotificationConfig {
    /**
     * Specifies the title of the notification.
     */
    title?: string;
    /**
     * Specifies the content to be displayed in the notification.
     *
     * The content may differ per notification provider, as determined by the qualifier. For example, the built-in notification expects a
     * text message in form of a string literal. Refer to the documentation of the notification capability provider for more information.
     */
    content?: unknown;
    /**
     * Passes data to the notification.
     *
     * The notification can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: Map<string, any> | Dictionary;
    /**
     * Specifies the severity of the notification. Defaults to `info`.
     */
    severity?: 'info' | 'warn' | 'error';
    /**
     * Specifies the timeout after which to close the notification automatically. Defaults to `medium`.
     * Can be either a duration alias, or a number in seconds.
     */
    duration?: 'short' | 'medium' | 'long' | 'infinite' | number;
    /**
     * Specifies the group which this notification belongs to.
     * If specified, the notification will replace any previously displayed notification of the same group.
     */
    group?: string;
    /**
     * Specifies CSS class(es) to add to the notification, e.g., to locate the notification in tests.
     */
    cssClass?: string | string[];
}

/**
 * Allows displaying a notification to the user.
 *
 * A notification is a closable message that appears in the upper-right corner and disappears automatically after a few seconds.
 * It informs the user of a system event, e.g., that a task has been completed or an error has occurred.
 *
 * Multiple notifications are stacked vertically. Notifications can be grouped. For each group, only the last notification is
 * displayed at any given time.
 *
 * The built-in notification supports the display of a plain text message and is available as 'notification' capability without a qualifier.
 * Other notification capabilities can be contributed in the host app, e.g., to display structured content or to provide out-of-the-box
 * notification templates. The use of a qualifier distinguishes different notification providers.
 *
 * Applications need to declare an intention in their application manifest for displaying a notification to the user, as illustrated below:
 *
 * ```json
 * {
 *   "intentions": [
 *     { "type": "notification" }
 *   ]
 * }
 * ```
 *
 * @see WorkbenchNotificationCapability
 * @category Notification
 */
declare class WorkbenchNotificationService {
    /**
     * Presents the user with a notification that is displayed in the upper-right corner based on the given qualifier.
     *
     * The qualifier identifies the provider to display the notification. The build-in notification to display a plain text message requires
     * no qualifier.
     *
     * @param  notification - Configures the content and appearance of the notification.
     * @param  qualifier - Identifies the notification provider.
     *
     * @return Promise that resolves when displaying the notification, or that rejects if displaying the notification failed, e.g., if missing
     *         the notification intention, or because no notification provider could be found that provides a notification under the specified
     *         qualifier.
     */
    show(notification: string | WorkbenchNotificationConfig, qualifier?: Qualifier): Promise<void>;
}

/**
 * Enables an application to monitor the workbench theme.
 */
declare abstract class WorkbenchThemeMonitor {
    /**
     * Emits the current workbench theme.
     *
     * Upon subscription, emits the current theme, and then continuously emits when switching the theme. It never completes.
     */
    abstract readonly theme$: Observable<WorkbenchTheme | null>;
}
/**
 * Information about a workbench theme.
 */
interface WorkbenchTheme {
    /**
     * The name of the theme.
     */
    name: string;
    /**
     * The color scheme of the theme.
     */
    colorScheme: 'light' | 'dark';
}

/**
 * Context key to retrieve information about the current workbench theme.
 *
 * @docs-private Not public API, intended for internal use only.
 * @ignore
 * @see {@link ContextService}
 */
declare const ɵTHEME_CONTEXT_KEY = "\u0275workbench.theme";

/**
 * Provides a workbench perspective.
 *
 * A perspective is a named layout. Multiple perspectives can be created. Users can switch between perspectives.
 * Perspectives share the same main area, if any.
 */
interface WorkbenchPerspectiveCapability extends Capability {
    /**
     * @inheritDoc
     */
    type: WorkbenchCapabilities.Perspective;
    /**
     * Qualifies this perspective. The qualifier is required for perspectives.
     *
     * @inheritDoc
     */
    qualifier: Qualifier;
    /**
     * @inheritDoc
     */
    properties: {
        /**
         * Defines the layout of this perspective.
         *
         * A perspective defines an arrangement of parts and views. Parts can be docked to the side or positioned relative to each other.
         * Views are stacked in parts and can be dragged to other parts. Content can be displayed in both parts and views.
         *
         * Users can personalize the layout of a perspective and switch between perspectives. The workbench remembers the last layout of each perspective,
         * restoring it the next time it is activated.
         *
         * A perspective typically has a main area part and other parts docked to the side, providing navigation and context-sensitive assistance to support
         * the user's workflow. Initially empty or displaying a welcome page, the main area is where the workbench opens new views by default.
         * Unlike any other part, the main area is shared between perspectives, and its layout is not reset when resetting perspectives.
         *
         * ## Example
         * The following example defines a layout with a main area and three parts:
         *
         * ```plain
         * +--------+----------------+
         * |  top   |                |
         * |  left  |                |
         * |--------+   main area    |
         * | bottom |                |
         * |  left  |                |
         * +--------+----------------+
         * |          bottom         |
         * +-------------------------+
         * ```
         *
         * ```json
         * {
         *   "layout": [
         *     {
         *       "id": "main-area"
         *     },
         *     {
         *       "id": "topLeft",
         *       "align": "left",
         *       "ratio": 0.25,
         *       "views": [
         *         {
         *           "qualifier": {
         *             "view": "navigator"
         *           }
         *         },
         *         {
         *           "qualifier": {
         *             "view": "explorer"
         *           }
         *         }
         *       ]
         *     },
         *     {
         *       "id": "bottomLeft",
         *       "relativeTo": "topLeft",
         *       "align": "bottom",
         *       "ratio": 0.5,
         *       "views": [
         *         {
         *           "qualifier": {
         *             "view": "properties"
         *           }
         *         }
         *       ]
         *     },
         *     {
         *       "id": "bottom",
         *       "align": "bottom",
         *       "ratio": 0.25,
         *       "views": [
         *         {
         *           "qualifier": {
         *             "view": "problems"
         *           }
         *         }
         *       ]
         *     }
         *   ]
         * }
         * ```
         */
        layout: [Pick<WorkbenchPerspectivePart, 'id' | 'views'>, ...WorkbenchPerspectivePart[]];
        /**
         * Arbitrary data associated with this perspective.
         */
        data?: {
            [key: string]: unknown;
        };
    };
}
/**
 * Represents a part in a workbench perspective.
 *
 * A part is a stack of views that can be arranged in a perspective.
 */
interface WorkbenchPerspectivePart {
    /**
     * Identifies the part. Use {@link MAIN_AREA} to reference the main area part.
     */
    id: string | MAIN_AREA;
    /**
     * Specifies the part which to use as the reference part to lay out the part.
     * If not set, the part will be aligned relative to the root of the layout.
     */
    relativeTo?: string;
    /**
     * Specifies the side of the reference part where to add the part.
     */
    align: 'left' | 'right' | 'top' | 'bottom';
    /**
     * Specifies the proportional size of the part relative to the reference part.
     * The ratio is the closed interval [0,1]. If not set, defaults to `0.5`.
     */
    ratio?: number;
    /**
     * Defines views to add to the part.
     *
     * Microfrontends provided as view capability can be referenced. Views are added in declaration order.
     * Views cannot be added to the main area part.
     */
    views?: WorkbenchPerspectiveView[];
}
/**
 * Represents a view in a workbench perspective.
 */
interface WorkbenchPerspectiveView {
    /**
     * Identifies the view capability that provides the microfrontend to add as view.
     *
     * An application can reference the public view capabilities of other applications if it manifests a respective intention.
     */
    qualifier: Qualifier;
    /**
     * Passes data to the view.
     *
     * The view can declare mandatory and optional parameters. No additional parameters are allowed. Refer to the documentation of the capability for more information.
     */
    params?: {
        [name: string]: unknown;
    };
    /**
     * Controls whether to activate the view. If not specified, activates the first view of the part.
     */
    active?: boolean;
    /**
     * Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.
     */
    cssClass?: string | string[];
}
/**
 * Identifies the main area part in the workbench layout.
 *
 * Refer to this part to align parts relative to the main area.
 *
 * The main area is a special part that can be added to the layout. The main area is where the workbench opens new views by default.
 * It is shared between perspectives and its layout is not reset when resetting perspectives.
 */
declare const MAIN_AREA: MAIN_AREA;
/**
 * Represents the type of the {@link MAIN_AREA} constant.
 */
type MAIN_AREA = 'part.main-area';

export { MAIN_AREA, WorkbenchCapabilities, WorkbenchClient, WorkbenchDialog, WorkbenchDialogService, WorkbenchMessageBox, WorkbenchMessageBoxService, WorkbenchNotificationService, WorkbenchPopup, WorkbenchPopupService, WorkbenchRouter, WorkbenchThemeMonitor, WorkbenchView, eMESSAGE_BOX_MESSAGE_PARAM, ɵDIALOG_CONTEXT, ɵMESSAGE_BOX_CONTEXT, ɵMicrofrontendRouteParams, ɵPOPUP_CONTEXT, ɵTHEME_CONTEXT_KEY, ɵVIEW_ID_CONTEXT_KEY, ɵWorkbenchCommands, ɵWorkbenchDialogMessageHeaders, ɵWorkbenchDialogService, ɵWorkbenchMessageBoxService, ɵWorkbenchPopupMessageHeaders, ɵWorkbenchView };
export type { BottomLeftPoint, BottomRightPoint, CanCloseFn, CanCloseRef, CloseStrategy, Empty, Point, PopupOrigin, PopupSize, TopLeftPoint, TopRightPoint, ViewId, ViewParamDefinition, ViewSnapshot, WorkbenchDialogCapability, WorkbenchDialogOptions, WorkbenchDialogSize, WorkbenchMessageBoxCapability, WorkbenchMessageBoxOptions, WorkbenchMessageBoxSize, WorkbenchNavigationExtras, WorkbenchNotificationCapability, WorkbenchNotificationConfig, WorkbenchPerspectiveCapability, WorkbenchPerspectivePart, WorkbenchPerspectiveView, WorkbenchPopupCapability, WorkbenchPopupConfig, WorkbenchPopupReferrer, WorkbenchTheme, WorkbenchViewCapability, ɵDialogContext, ɵMessageBoxContext, ɵPopupContext, ɵViewParamsUpdateCommand, ɵWorkbenchPopupCommand };
