import { Observable, MonoTypeOperatorFunction, OperatorFunction, Subscription } from 'rxjs';
import { Dictionary } from '@scion/toolkit/util';
import { PreDestroy, Initializer } from '@scion/toolkit/bean-manager';

/**
 * Lifecycle states of the microfrontend platform.
 *
 * @category Platform
 */
declare enum PlatformState {
    /**
     * Indicates that the platform is about to start.
     */
    Starting = 1,
    /**
     * Indicates that the platform started.
     */
    Started = 2,
    /**
     * Indicates that the platform is about to stop.
     */
    Stopping = 3,
    /**
     * Indicates that the platform is not yet started.
     */
    Stopped = 4
}

/**
 * The central class of the SCION Microfrontend Platform. This class cannot be instantiated. All functionality is provided by static methods.
 *
 * To enable tree-shaking of the SCION Microfrontend Platform, the platform provides three separate entry points:
 * - {@link MicrofrontendPlatformHost} to configure and start the platform in the host
 * - {@link MicrofrontendPlatformClient} to connect to the platform from a microfrontend
 * - {@link MicrofrontendPlatform} to react to platform lifecycle events and stop the platform
 *
 * ## SCION Microfrontend Platform
 *
 * SCION Microfrontend Platform is a TypeScript-based open source library that enables the implementation of a framework-agnostic
 * microfrontend architecture using iframes. It provides fundamental APIs for microfrontends to communicate with each other across origins
 * and facilitates embedding microfrontends using a web component and a router. SCION Microfrontend Platform is a lightweight, web stack
 * agnostic library that has no user-facing components and does not dictate any form of application structure.
 *
 * You can continue using the frameworks you love since the platform integrates microfrontends via iframes. Iframes by nature provide
 * maximum isolation and allow the integration of any web application without complex adaptation. The platform aims to shield developers
 * from iframe specifics and the low-level messaging mechanism to focus instead on integrating microfrontends.
 *
 * #### Cross-microfrontend communication
 * The platform adds a pub/sub layer on top of the native `postMessage` mechanism to enable microfrontends to communicate with each other
 * easily across origins. Communication comes in two flavors: topic-based and intent-based. Both models feature request-response message
 * exchange, support retained messages for late subscribers to receive the latest messages, and provide API to intercept messages to
 * implement cross-cutting messaging concerns.
 *
 * Topic-based messaging enables you to publish messages to multiple subscribers via a common topic. Intent-based communication focuses on
 * controlled collaboration between applications. To collaborate, an application must express an intention. Manifesting intentions enables
 * us to see dependencies between applications down to the functional level.
 *
 * #### Microfrontend Integration and Routing
 * The platform makes it easy to integrate microfrontends through its router-outlet. The router-outlet is a web component that wraps an iframe.
 * It solves many of the cumbersome quirks of iframes and helps to overcome iframe restrictions. For example, it can adapt its size to the
 * preferred size of embedded content, supports keyboard event propagation and lets you pass contextual data to embedded content.
 * Using the router, you control which web content to display in an outlet. Multiple outlets can display different content, determined by
 * different outlet names, all at the same time. Routing works across application boundaries and enables features such as persistent navigation.
 *
 * ***
 *
 * A microfrontend architecture can be achieved in many ways, each with its pros and cons. The SCION Microfrontend Platform uses
 * the iframe approach primarily since iframes by nature provide the highest possible level of isolation through a separate browsing context.
 * The microfrontend design approach is very tempting and has obvious advantages, especially for large-scale and long-lasting projects, most
 * notably because we are observing an enormous dynamic in web frameworks. The SCION Microfrontend Platform provides you with the necessary
 * tools to best support you in implementing such an architecture.
 *
 * @see {@link MicrofrontendPlatformHost}
 * @see {@link MicrofrontendPlatformClient}
 *
 * @see {@link MessageClient}
 * @see {@link IntentClient}
 * @see {@link SciRouterOutletElement}
 * @see {@link OutletRouter}
 * @see {@link ContextService}
 * @see {@link PreferredSizeService}
 * @see {@link ManifestService}
 * @see {@link FocusMonitor}
 * @see {@link ActivatorCapability}
 *
 * @category Platform
 * @category Lifecycle
 */
declare class MicrofrontendPlatform {
    private static readonly _state$;
    private constructor();
    /**
     * Destroys this platform and releases resources allocated.
     *
     * @return a Promise that resolves once the platformed stopped.
     */
    static destroy(): Promise<void>;
    /**
     * @return the current platform state.
     */
    static get state(): PlatformState;
    /**
     * Observable that, when subscribed, emits the current platform lifecycle state.
     * It never completes and emits continuously when the platform enters
     * another state.
     */
    static get state$(): Observable<PlatformState>;
    /**
     * Waits for the platform to enter the specified {@link PlatformState}.
     * If already in that state, the Promise resolves instantly.
     *
     * @param  state - the state to wait for.
     * @return A Promise that resolves when the platform enters the given state.
     *         If already in that state, the Promise resolves instantly.
     */
    static whenState(state: PlatformState): Promise<void>;
    private static enterState;
}

/**
 * Describes how to register an application in the platform.
 *
 * @category Platform
 */
interface ApplicationConfig {
    /**
     * Unique symbolic name of this micro application.
     *
     * The symbolic name must be unique and contain only lowercase alphanumeric characters and hyphens.
     */
    symbolicName: string;
    /**
     * URL to the application manifest.
     */
    manifestUrl: string;
    /**
     * Specifies an additional origin (in addition to the origin of the application) from which the application is allowed
     * to connect to the platform.
     *
     * By default, if not set, the application is allowed to connect from the origin of the manifest URL or the base URL as
     * specified in the manifest file. Setting an additional origin may be necessary if, for example, integrating microfrontends
     * into a rich client, enabling an integrator to bridge messages between clients and host across browser boundaries.
     */
    secondaryOrigin?: string;
    /**
     * Maximum time (in milliseconds) that the host waits until the manifest for this application is loaded.
     *
     * If set, overrides the global timeout as configured in {@link MicrofrontendPlatformConfig.manifestLoadTimeout}.
     */
    manifestLoadTimeout?: number;
    /**
     * Maximum time (in milliseconds) for this application to signal readiness.
     *
     * If activating this application takes longer, the host logs an error and continues startup.
     * If set, overrides the global timeout as configured in {@link MicrofrontendPlatformConfig.activatorLoadTimeout}.
     */
    activatorLoadTimeout?: number;
    /**
     * Excludes this micro application from registration, e.g. to not register it in a specific environment.
     */
    exclude?: boolean;
    /**
     * Allows this application to access private capabilities of other applications.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    scopeCheckDisabled?: boolean;
    /**
     * Allows this application to access public capabilities of other applications without declaring an intention.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    intentionCheckDisabled?: boolean;
    /**
     * Allows this application to access inactive capabilities.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    capabilityActiveCheckDisabled?: boolean;
    /**
     * Allows this application to register and unregister intentions at runtime.
     *
     * Enabling this API is discouraged. Disabled by default.
     */
    intentionRegisterApiDisabled?: boolean;
}

/**
 * Manifest of an application.
 *
 * The manifest is a special file that contains information about a micro application. A micro application declares
 * its intentions and capabilities in its manifest file. The manifest needs to be registered in the host application.
 *
 * @category Platform
 * @category Intention API
 */
interface Manifest {
    /**
     * The name of the application, e.g. displayed in the DevTools.
     */
    name: string;
    /**
     * URL to the application root. The URL can be fully qualified, or a path relative to the origin under
     * which serving the manifest file. If not specified, the origin of the manifest file acts as the base
     * URL. The platform uses the base URL to resolve microfrontends such as activator endpoints.
     * For a Single Page Application that uses hash-based routing, you typically specify the hash symbol (`#`)
     * as the base URL.
     */
    baseUrl?: string;
    /**
     * Functionality which this application intends to use.
     */
    intentions?: Intention[];
    /**
     * Functionality which this application provides that qualified apps can call via intent.
     */
    capabilities?: Capability[];
}
/**
 * Represents a dictionary of key-value pairs to qualify an intention, intent or capability.
 *
 * See {@link Intention}, {@link Capability} or {@link Intent} for the usage of wildcards
 * in qualifier properties.
 *
 * @category Intention API
 */
interface Qualifier {
    [key: string]: string | number | boolean;
}
/**
 * Represents an application registered in the platform.
 *
 * @category Platform
 */
interface Application {
    /**
     * Unique symbolic name of the application.
     */
    symbolicName: string;
    /**
     * Name of the application as specified in the manifest.
     */
    name: string;
    /**
     * URL to the application root.
     */
    baseUrl: string;
    /**
     * URL to the manifest of this application.
     */
    manifestUrl: string;
    /**
     * Maximum time (in milliseconds) that the host waits until the manifest for this application is loaded.
     *
     * This is the effective timeout, i.e, either the application-specific timeout as defined in {@link ApplicationConfig.manifestLoadTimeout},
     * or the global timeout as defined in {@link MicrofrontendPlatformConfig.manifestLoadTimeout}, otherwise `undefined`.
     */
    manifestLoadTimeout?: number;
    /**
     * Maximum time (in milliseconds) that the host waits for this application to signal readiness.
     *
     * This is the effective timeout, i.e, either the application-specific timeout as defined in {@link ApplicationConfig.activatorLoadTimeout},
     * or the global timeout as defined in {@link MicrofrontendPlatformConfig.activatorLoadTimeout}, otherwise `undefined`.
     */
    activatorLoadTimeout?: number;
    /**
     * Indicates whether this application is allowed to access private capabilities of other applications.
     */
    scopeCheckDisabled: boolean;
    /**
     * Indicates whether this application is allowed to access public capabilities of other applications without declaring an intention.
     */
    intentionCheckDisabled: boolean;
    /**
     * Indicates whether this application is allowed to access inactive capabilities.
     */
    capabilityActiveCheckDisabled: boolean;
    /**
     * Indicates whether this application is allowed to register and unregister intentions at runtime.
     */
    intentionRegisterApiDisabled: boolean;
    /**
     * Version of the SCION Microfrontend Platform used by this application.
     */
    platformVersion: Promise<string>;
}
/**
 * The term capability refers to the Intention API of the SCION Microfrontend Platform.
 *
 * A capability represents some functionality of a micro application that is available to qualified micro applications through the Intention API.
 * A micro application declares its capabilities in its manifest. Qualified micro applications can browse capabilities similar to a catalog, or
 * interact with capabilities via intent.
 *
 * A capability is formulated in an abstract way consisting of a type and optionally a qualifier. The type categorizes a capability in terms of its
 * functional semantics. A capability may also define a qualifier to differentiate different capabilities of the same type.
 *
 * A capability can have private or public visibility. If private, which is by default, the capability is not visible to other micro
 * applications; thus, it can only be invoked or browsed by the providing micro application itself.
 *
 * A capability can specify parameters which the intent issuer can/must pass along with the intent. Parameters are part of the contract between
 * the intent publisher and the capability provider. They do not affect the intent routing, unlike the qualifier.
 *
 * Metadata can be associated with a capability in its properties section. For example, if providing a microfrontend, the URL to the
 * microfrontend can be added as property, or if the capability contributes an item to a menu, its label to be displayed.
 *
 * @category Intention API
 */
interface Capability {
    /**
     * Categorizes the capability in terms of its functional semantics (e.g., `microfrontend` if providing a microfrontend).
     * It can be an arbitrary `string` literal and has no meaning to the platform.
     */
    type: string;
    /**
     * The qualifier is a dictionary of arbitrary key-value pairs to differentiate capabilities of the same `type` and is like
     * an abstract description of the capability. It should include enough information to uniquely identify the capability.
     *
     * Intents must exactly match the qualifier of the capability, if any.
     */
    qualifier?: Qualifier;
    /**
     * Specifies parameters which the intent issuer can/must pass along with the intent.
     *
     * Parameters are part of the contract between the intent publisher and the capability provider.
     * They do not affect the intent routing, unlike the qualifier.
     */
    params?: ParamDefinition[];
    /**
     * Controls whether this capability is private. Defaults to `true`.
     *
     * If private, the capability is not visible to other applications and can only be accessed by the providing application.
     *
     * Note: Applications configured with `scopeCheckDisabled` can still access private capabilities (discouraged).
     */
    private?: boolean;
    /**
     * Controls whether this capability is inactive. Defaults to `false`.
     *
     * Capabilities can be marked as inactive in a capability interceptor, for example, based on user permissions.
     * Inactive capabilities are unavailable to applications but still visible in the SCION DevTools for discovery.
     *
     * Note: Applications configured with `capabilityActiveCheckDisabled` can still access inactive capabilities (discouraged).
     */
    inactive?: boolean;
    /**
     * A short description to explain the capability.
     */
    description?: string;
    /**
     * Arbitrary metadata to be associated with the capability.
     */
    properties?: {
        [key: string]: unknown;
    };
    /**
     * Metadata about the capability (read-only, exclusively managed by the platform).
     * @ignore
     */
    metadata?: {
        /**
         * Unique identity of this capability.
         */
        id: string;
        /**
         * Symbolic name of the application which provides this capability.
         */
        appSymbolicName: string;
    };
}
/**
 * The term intention refers to the Intention API of the SCION Microfrontend Platform.
 *
 * An intention refers to one or more capabilities that a micro application wants to interact with.
 *
 * Intentions are declared in the application’s manifest and are formulated in an abstract way, consisting of a type
 * and optionally a qualifier. The qualifier is used to differentiate capabilities of the same type.
 *
 * @category Intention API
 */
interface Intention {
    /**
     * The type of capability to interact with.
     */
    type: string;
    /**
     * Qualifies the capability which to interact with.
     *
     * The qualifier is a dictionary of arbitrary key-value pairs to differentiate capabilities of the same `type`.
     *
     * The intention must exactly match the qualifier of the capability, if any. The intention qualifier allows using
     * wildcards to match multiple capabilities simultaneously.
     *
     * In the intention, the following wildcards are supported:
     * - **Asterisk wildcard character (`*`):**\
     *   Matches capabilities with such a qualifier property no matter of its value (except `null` or `undefined`).
     *   Use it like this: `{property: '*'}`.
     * - **Partial wildcard (`**`):**
     *   Matches capabilities even if having additional properties. Use it like this: `{'*': '*'}`.
     */
    qualifier?: Qualifier;
    /**
     * Metadata about this intention (read-only, exclusively managed by the platform).
     * @ignore
     */
    metadata?: {
        /**
         * Unique identity of this intent declaration.
         */
        id: string;
        /**
         * Symbolic name of the application which declares this intention.
         */
        appSymbolicName: string;
    };
}
/**
 * Built in capability types.
 *
 * @category Intention API
 */
declare enum PlatformCapabilityTypes {
    /**
     * Type for registering an activator capability.
     *
     * @see ActivatorCapability
     */
    Activator = "activator",
    /**
     * Type for registering a microfrontend capability.
     *
     * @see MicrofrontendCapability
     */
    Microfrontend = "microfrontend"
}
/**
 * An activator allows a micro application to initialize and connect to the platform upon host application's startup,
 * i.e., when the user loads the web application into the browser.
 *
 * In the broadest sense, an activator is a kind of microfrontend, i.e. an HTML page that runs in an iframe. In contrast
 * to regular microfrontends, however, at platform startup, the platform loads activator microfrontends into hidden iframes
 * for the entire platform lifecycle, thus, providing a stateful session to the micro application on the client-side.
 *
 * Some typical use cases for activators are receiving messages and intents, preloading data, or flexibly providing capabilities.
 *
 * A micro application registers an activator as public _activator_ capability in its manifest, as follows:
 *
 * ```json
 * "capabilities": [
 *   {
 *     "type": "activator",
 *     "private": false,
 *     "properties": {
 *       "path": "path/to/the/activator"
 *     }
 *   }
 * ]
 * ```
 *
 * #### Activation Context
 * An activator's microfrontend runs inside an activation context. The context provides access
 * to the activator capability, allowing to read properties declared on the activator capability.
 *
 * You can obtain the activation context using the {@link ContextService} as following.
 *
 * ```ts
 * // Looks up the activation context.
 * const ctx: ActivationContext = await Beans.get(ContextService).lookup(ACTIVATION_CONTEXT);
 * ```
 *
 * #### Multiple Activators
 * A micro application can register multiple activators. Note, that each activator boots the micro
 * application on its own and runs in a separate browsing context. The platform nominates one activator
 * of each micro application as its primary activator. The nomination has no relevance to the platform but
 * can help code decide whether to install singleton functionality.
 *
 * You can test if running in the primary activation context as following.
 * ```ts
 * // Looks up the activation context.
 * const ctx = await Beans.get(ContextService).lookup<ActivationContext>(ACTIVATION_CONTEXT);
 * // Checks if running in the context of the primary activator.
 * const isPrimary: boolean = ctx.primary;
 * ```
 *
 * #### Sharing State
 * Since an activator runs in a separate browsing context, microfrontends cannot directly access its state.
 * Instead, an activator could put data, for example, into session storage, so that microfrontends of its micro
 * application can access it. Alternatively, an activator could install a message listener, allowing microfrontends
 * to request data via client-side messaging.
 *
 * @category Platform
 * @category Intention API
 */
interface ActivatorCapability extends Capability {
    type: PlatformCapabilityTypes.Activator;
    private: false;
    properties: {
        /**
         * Path where the platform can load the activator microfrontend. The path is relative to the base URL
         * of the micro application, as specified in the application manifest.
         */
        path: string;
        /**
         * Starting an activator may take some time. In order not to miss any messages or intents, you can instruct the platform host to
         * wait to enter started state until you signal the activator to be ready. For this purpose, you can define a set of topics where
         * to publish a ready message to signal readiness. If you specify multiple topics, the activator enters ready state after you have
         * published a ready message to all these topics. A ready message is an event; thus, a message without payload.
         *
         * If not specifying a readiness topic, the platform host does not wait for this activator to become ready. However, if you specify a
         * readiness topic, make sure that your activator has a fast startup time and signals readiness as early as possible not to delay
         * the startup of the platform host.
         */
        readinessTopics?: string | string[];
        /**
         * Arbitrary metadata to be associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Represents a microfrontend that can be loaded into a <sci-router-outlet> using the {@link OutletRouter}.
 *
 * @category Intention API
 */
interface MicrofrontendCapability extends Capability {
    type: PlatformCapabilityTypes.Microfrontend;
    properties: {
        /**
         * Specifies the path of the microfrontend.
         *
         * 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.
         *
         * The path allows the use of navigational symbols and named parameters to reference qualifier and parameter values.
         * A named parameter begins with a colon (`:`) followed by the qualifier or parameter name, and is allowed in path segments,
         * query parameters, matrix parameters and the fragment part. Named query and matrix parameters without a replacement are removed,
         * e.g., if referencing an optional parameter.
         *
         * #### Usage of named parameters in the path:
         * ```json
         * {
         *   "type": "microfrontend",
         *   "qualifier": {
         *     "entity": "product"
         *   },
         *   "params": [
         *     {"name": "id", "required": true}
         *   ]
         *   "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 outlet to load this microfrontend into.
         * Note that this preference is only a hint that will be ignored if the navigator
         * specifies an outlet for navigation.
         *
         * The precedence is as follows:
         * - Outlet as specified by navigator via {@link NavigationOptions#outlet}.
         * - Preferred outlet as specified in the microfrontend capability.
         * - Current outlet if navigating in the context of an outlet.
         * - {@link PRIMARY_OUTLET primary} outlet.
         */
        outlet?: string;
        /**
         * Instructs the router outlet to show a splash, such as a skeleton or loading indicator, until the microfrontend signals readiness.
         * The splash is the markup between the opening and closing tags of the router outlet element.
         *
         * @see SciRouterOutletElement
         * @see MicrofrontendPlatformClient.signalReady
         */
        showSplash?: boolean;
        /**
         * Arbitrary metadata to be associated with the capability.
         */
        [key: string]: unknown;
    };
}
/**
 * Describes a parameter to be passed along with an intent.
 *
 * @category Intention API
 */
interface ParamDefinition {
    /**
     * Specifies the name of the parameter.
     */
    name: string;
    /**
     * Describes the parameter and its usage in more detail.
     */
    description?: string;
    /**
     * Specifies whether the parameter must be passed along with the intent.
     */
    required: boolean;
    /**
     * Defines a default value. Only applies to optional parameters.
     *
     * The default value is used when the parameter is not provided.
     */
    default?: unknown;
    /**
     * Allows deprecating the parameter.
     *
     * It is good practice to explain the deprecation, provide the date of removal, and how to migrate.
     * If renaming the parameter, you can set the `useInstead` property to specify which parameter to use
     * instead. At runtime, this will map the parameter to the specified replacement, allowing for
     * straightforward migration on the provider side.
     */
    deprecated?: true | {
        message?: string;
        useInstead?: string;
    };
    /**
     * Allows the declaration of additional metadata that can be interpreted in an interceptor, for example.
     */
    [property: string]: unknown;
}
/**
 * Symbol to determine if this app instance is running as the platform host.
 *
 * ```ts
 * const isPlatformHost: boolean = Beans.get(IS_PLATFORM_HOST);
 * ```
 *
 * @category Platform
 */
declare const IS_PLATFORM_HOST: unique symbol;
/**
 * Symbol to get the application's symbolic name from the bean manager.
 *
 * @category Platform
 */
declare const APP_IDENTITY: unique symbol;
/**
 * Key for obtaining the current activation context using {@link ContextService}.
 *
 * The activation context is only available to microfrontends loaded by an activator.
 *
 * @see {@link ActivationContext}
 * @see {@link ContextService}
 * @category Platform
 */
declare const ACTIVATION_CONTEXT = "\u0275ACTIVATION_CONTEXT";
/**
 * Information about the activator that loaded a microfrontend.
 *
 * This context is available to a microfrontend if loaded by an application activator.
 * This object can be obtained from the {@link ContextService} using the name {@link ACTIVATION_CONTEXT}.
 *
 * ```ts
 * const ctx = await Beans.get(ContextService).lookup<ActivationContext>(ACTIVATION_CONTEXT);
 * ```
 *
 * @see {@link ACTIVATION_CONTEXT}
 * @see {@link ContextService}
 * @category Platform
 */
interface ActivationContext {
    /**
     * Indicates whether running in the context of the primary activator.
     * The platform nominates one activator of each app as primary activator.
     */
    primary: boolean;
    /**
     * Metadata about the activator that activated the microfrontend.
     */
    activator: ActivatorCapability;
}
/**
 * Allows filtering manifest objects like capabilities or intentions.
 *
 * All specified filter criteria are "AND"ed together. Unspecified filter criteria are ignored.
 * If no filter criterion is specified, no filtering takes place, thus all available objects are returned.
 *
 * @category Intention API
 */
interface ManifestObjectFilter {
    /**
     * Manifest objects of the given identity.
     */
    id?: string;
    /**
     * Manifest objects of the given function type.
     */
    type?: string;
    /**
     * Manifest objects matching the given qualifier.
     */
    qualifier?: Qualifier;
    /**
     * Manifest objects provided by the given app.
     */
    appSymbolicName?: string;
}
/**
 * Represents a request to determine if an application is qualified to interact with a given capability.
 */
interface ApplicationQualifiedForCapabilityRequest {
    /**
     * Specifies the symbolic name of the application under test.
     */
    appSymbolicName: string;
    /**
     * Identifies the capability for which to request the application's qualification.
     */
    capabilityId: string;
}

/**
 * Configures the interaction of the host application with the platform.
 *
 * As with micro applications, you can provide a manifest for the host, allowing the host to contribute capabilities and declare intentions.
 *
 * @category Platform
 */
interface HostConfig {
    /**
     * Symbolic name of the host. If not set, 'host' is used as the symbolic name of the host.
     *
     * The symbolic name must be unique and contain only lowercase alphanumeric characters and hyphens.
     */
    symbolicName?: string;
    /**
     * The manifest of the host.
     *
     * The manifest can be passed either as an {@link Manifest object literal} or specified as a URL to be loaded over the network.
     * Providing a manifest lets the host contribute capabilities or declare intentions.
     */
    readonly manifest?: Manifest | string;
    /**
     * Allows the host to access private capabilities of other applications.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    readonly scopeCheckDisabled?: boolean;
    /**
     * Allows the host to access public capabilities of other applications without declaring an intention.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    readonly intentionCheckDisabled?: boolean;
    /**
     * Allows the host to access inactive capabilities.
     *
     * Disabling this check is discouraged. Enabled by default.
     */
    readonly capabilityActiveCheckDisabled?: boolean;
    /**
     * Allows the host to register and unregister intentions at runtime.
     *
     * Enabling this API is discouraged. Disabled by default.
     */
    readonly intentionRegisterApiDisabled?: boolean;
    /**
     * Maximum time (in milliseconds) that the platform waits to receive dispatch confirmation for messages sent by the host until rejecting the publishing Promise.
     * By default, a timeout of 10s is used.
     */
    readonly messageDeliveryTimeout?: number;
}

/**
 * Configures the liveness probe performed between host and clients to detect and dispose stale clients.
 * Clients not replying to the probe are removed.
 *
 * @category Platform
 */
interface LivenessConfig {
    /**
     * Interval (in seconds) at which liveness probes are performed between host and connected clients.
     * Note that the interval must not be 0 and be greater than twice the timeout period to give a probe enough time to complete before performing a new probe.
     *
     * By default, if not set, an interval of 60s is used.
     */
    interval: number;
    /**
     * Timeout (in seconds) after which a client is unregistered if not replying to the probe.
     * Note that timeout must not be 0 and be less than half the interval period to give a probe enough time to complete before performing a new probe.
     *
     * By default, if not set, a timeout of 10s is used.
     */
    timeout: number;
}

/**
 * Configures the platform and defines the micro applications running in the platform.
 *
 * @category Platform
 */
declare abstract class MicrofrontendPlatformConfig {
    /**
     * Lists the micro applications able to connect to the platform to interact with other micro applications.
     */
    abstract readonly applications: ApplicationConfig[];
    /**
     * Configures the interaction of the host application with the platform.
     *
     * As with micro applications, you can provide a manifest for the host, allowing the host to contribute capabilities and declare intentions.
     */
    abstract readonly host?: HostConfig;
    /**
     * Controls whether the Activator API is enabled.
     *
     * Activating the Activator API enables micro applications to contribute `activator` microfrontends. Activator microfrontends are loaded
     * at platform startup for the entire lifecycle of the platform. An activator is a startup hook for micro applications to initialize
     * or register message or intent handlers to provide functionality.
     *
     * By default, this API is enabled.
     *
     * @see {@link ActivatorCapability}
     */
    abstract readonly activatorApiDisabled?: boolean;
    /**
     * Maximum time (in milliseconds) that the platform waits until the manifest of an application is loaded.
     * You can set a different timeout per application via {@link ApplicationConfig.manifestLoadTimeout}.
     * If not set, by default, the browser's HTTP fetch timeout applies.
     *
     * Consider setting this timeout if, for example, a web application firewall delays the responses of unavailable
     * applications.
     */
    abstract readonly manifestLoadTimeout?: number;
    /**
     * Maximum time (in milliseconds) for each application to signal readiness.
     *
     * If specified and activating an application takes longer, the host logs an error and continues startup.
     * Has no effect for applications which provide no activator(s) or are not configured to signal readiness.
     * You can set a different timeout per application via {@link ApplicationConfig.activatorLoadTimeout}.
     *
     * By default, no timeout is set, meaning that if an app fails to signal readiness, e.g., due to an error,
     * that app would block the host startup process indefinitely. It is therefore recommended to specify a
     * timeout accordingly.
     */
    abstract readonly activatorLoadTimeout?: number;
    /**
     * Configures the liveness probe performed at regular intervals between host and clients to detect and dispose stale clients.
     * Clients not replying to the probe are removed.
     */
    abstract readonly liveness?: LivenessConfig;
    /**
     * Defines user-defined properties which can be read by micro applications via {@link PlatformPropertyService}.
     */
    abstract readonly properties?: {
        [key: string]: unknown;
    };
}

/**
 * Main entry point for configuring and starting the platform in the host application. This class cannot be instantiated. All functionality is provided by static methods.
 *
 * The host application, sometimes also called the container application, provides the top-level integration container for microfrontends. Typically, it is the web
 * application which the user loads into the browser that provides the main application shell, defining areas to embed microfrontends.
 *
 * In the host application the SCION Microfrontend Platform is configured and web applications that want to interact with the platform are registered.
 * The host application can provide a manifest to contribute behavior to integrated applications. For more information, see {@link HostConfig.manifest}
 * in {@link MicrofrontendPlatformConfig.host}.
 *
 * If integrating the SCION Microfrontend Platform in a library, the manifest of the host can be augmented by registering a {@link HostManifestInterceptor}.
 *
 * @see MicrofrontendPlatform
 * @see MicrofrontendPlatformHost
 * @see MicrofrontendPlatformClient
 *
 * @category Platform
 * @category Lifecycle
 */
declare class MicrofrontendPlatformHost {
    private static _startupProgress$;
    private constructor();
    /**
     * Starts the platform host.
     *
     * In the host application the SCION Microfrontend Platform is configured and web applications that want to interact with the platform are registered.
     *
     * The host application can provide a manifest to declare intentions and contribute behavior to integrated applications via {@link HostConfig.manifest} in
     * {@link MicrofrontendPlatformConfig.host}. The manifest can be specified either as an object literal or as a URL to load it over the network.
     *
     * The platform should be started during the bootstrapping of the host application. In Angular, for example, the platform is typically
     * started in an app initializer. Since starting the platform host may take some time, you should wait for the startup Promise to resolve
     * before interacting with the platform.
     *
     * @param  config - Configures the platform and lists applications allowed to interact with the platform.
     * @return A Promise that resolves when started the platform host.
     */
    static start(config: MicrofrontendPlatformConfig): Promise<void>;
    /**
     * Monitors the startup progress of the platform host.
     *
     * Starting the platform host may take some time. During startup, the manifests of the registered applications are fetched,
     * activator microfrontends are installed, and the platform waits until all applications have signaled readiness.
     *
     * Subscribe to this Observable to monitor the startup progress and provide feedback to the user like displaying a
     * progress bar or a spinner. The Observable reports the progress as a percentage number. The Observable completes
     * after the platform has been started.
     */
    static get startupProgress$(): Observable<number>;
}

/**
 * Enables modification of capabilities before they are registered.
 *
 * Interceptors can intercept capabilities before they are registered, for example,
 * to perform validation checks, add metadata, change properties, or prevent registration
 * based on user permissions.
 *
 * The following interceptor assigns a stable identifier to each microfrontend capability.
 *
 * ```ts
 * class MicrofrontendCapabilityInterceptor implements CapabilityInterceptor {
 *
 *   public async intercept(capability: Capability): Promise<Capability> {
 *     if (capability.type === 'microfrontend') {
 *       return {
 *         ...capability,
 *         // `hash()` is illustrative and not part of the Microfrontend Platform API.
 *         metadata: {...capability.metadata, id: hash(capability)},
 *       };
 *     }
 *     return capability;
 *   }
 * }
 * ```
 *
 * The following interceptor marks capabilities as inactive based on user permissions.
 *
 * ```ts
 * class UserAuthorizedCapabilityInterceptor implements CapabilityInterceptor {
 *
 *   public async intercept(capability: Capability): Promise<Capability> {
 *     // Read required role from capability properties.
 *     const requiredRole = capability.properties?.['role'];
 *
 *     // Mark capability as inactive if the user has no permission.
 *     // `hasRole()` is illustrative and not part of the Microfrontend Platform API.
 *     capability.inactive = requiredRole && !hasRole(requiredRole);
 *
 *     return capability;
 *   }
 * }
 * ```
 * Alternatively, the capability can be rejected. Unlike inactive capabilities, rejected capabilities are not listed in the SCION DevTools.
 *
 * ```ts
 * class UserAuthorizedCapabilityInterceptor implements CapabilityInterceptor {
 *
 *   public async intercept(capability: Capability): Promise<Capability | null> {
 *     // Read required role from capability properties.
 *     const requiredRole = capability.properties?.['role'];
 *
 *     // `hasRole()` is illustrative and not part of the Microfrontend Platform API.
 *     return !requiredRole || hasRole(requiredRole) ? capability : null;
 *   }
 * }
 * ```
 *
 * The following interceptor extracts user information to a new capability.
 *
 * ```ts
 * class UserCapabilityMigrator implements CapabilityInterceptor {
 *
 *   public async intercept(capability: Capability, manifest: CapabilityInterceptor.Manifest): Promise<Capability> {
 *     if (capability.type === 'user' && capability.properties['info']) {
 *       // Move user info to new capability.
 *       await manifest.addCapability({
 *         type: 'user-info',
 *         properties: {
 *           ...capability.properties['info'],
 *         },
 *       });
 *       // Remove info on intercepted capability.
 *       delete capability.properties['info'];
 *     }
 *     return capability;
 *   }
 * }
 * ```
 *
 * #### Registering Interceptors
 * Interceptors are registered in the bean manager of the host application under the symbol `CapabilityInterceptor` as multi bean.
 * Multiple interceptors can be registered, forming a chain in which each interceptor is called one by one in registration order.
 *
 * ```ts
 * Beans.register(CapabilityInterceptor, {useClass: MicrofrontendCapabilityInterceptor, multi: true});
 * Beans.register(CapabilityInterceptor, {useClass: UserAuthorizedCapabilityInterceptor, multi: true});
 * Beans.register(CapabilityInterceptor, {useClass: UserCapabilityMigrator, multi: true});
 * ```
 *
 * @category Intention API
 */
declare abstract class CapabilityInterceptor {
    /**
     * Intercepts a capability before being registered.
     *
     * An interceptor can add extra capabilities and intentions to the manifest of the intercepted capability. This may be necessary to migrate capabilities.
     *
     * @param capability - Capability to be intercepted.
     * @param manifest - Manifest of the application that provides the intercepted capability, allowing for the registration of extra capabilities and intentions.
     * @return Promise that resolves to the intercepted capability, or `null` to prevent registration.
     */
    abstract intercept(capability: Capability, manifest: CapabilityInterceptor.Manifest): Promise<Capability | null>;
}
/**
 * Declares objects local to CapabilityInterceptor.
 */
declare namespace CapabilityInterceptor {
    /**
     * Manifest of the application that provides the intercepted capability.
     */
    interface Manifest {
        /**
         * Adds specified capability to the application of the intercepted capability.
         */
        addCapability<T extends Capability>(capability: T): Promise<string | null>;
        /**
         * Adds specified intention to the application of the intercepted capability.
         */
        addIntention(intention: Intention): Promise<string>;
    }
}

/**
 * Represents a message with headers to transport additional information with a message.
 *
 * @category Messaging
 */
interface Message {
    /**
     * Additional information attached to this message.
     *
     * Header values must be JSON serializable. If no headers are set, the `Map` is empty.
     */
    headers: Map<string, unknown>;
    /**
     * Indicates whether this message is retained on the broker for late subscribers.
     */
    retain?: boolean;
}
/**
 * Represents an intent sent by an application.
 *
 * The intent is transported to applications that provide a fulfilling capability visible to the sending application.
 *
 * @category Messaging
 * @category Intention API
 */
interface IntentMessage<BODY = unknown> extends Message {
    /**
     * Intent that represents this message.
     */
    intent: Intent;
    /**
     * Optional data passed along with the intent.
     */
    body?: BODY;
    /**
     * Capability that fulfills the intent.
     */
    capability: Capability;
}
/**
 * The term intention refers to the Intention API of the SCION Microfrontend Platform.
 *
 * The intent is the message that a micro application sends to interact with functionality that is available in the form of a capability.
 *
 * The platform transports the intent to the micro applications that provide the requested capability. A micro application can issue an
 * intent only if having declared an intention in its manifest. Otherwise, the platform rejects the intent.
 *
 * An intent is formulated in an abstract way, having assigned a type, and optionally a qualifier. This information is used for resolving
 * the capability; thus, it can be thought of as a form of capability addressing. See the definition of a capability for more information.
 *
 * @category Messaging
 * @category Intention API
 */
interface Intent {
    /**
     * Type of functionality to intend.
     */
    type: string;
    /**
     * The qualifier is an abstract description of the intent and is expressed in the form of a dictionary.
     *
     * When issuing an intent, the qualifier must be exact, i.e. not contain wildcards.
     */
    qualifier?: Qualifier;
    /**
     * Parameters allow additional data to be passed along with the intent.
     *
     * They are part of the contract between the intent publisher and the capability provider. The capability provider
     * can declare mandatory and optional parameters. No additional parameters may be included.
     *
     * Parameters have no effect on the intent routing, unlike the qualifier. If mandatory parameters
     * are missing or non-specified parameters are included, the intent is rejected.
     */
    params?: Map<string, unknown>;
}
/**
 * Represents a message published to a topic.
 *
 * The message is transported to all consumers subscribed to the topic.
 *
 * @category Messaging
 */
interface TopicMessage<BODY = unknown> extends Message {
    /**
     * The topic where to publish this message to.
     */
    topic: string;
    /**
     * Optional message.
     */
    body?: BODY;
    /**
     * Contains the resolved values of the wildcard segments as specified in the topic.
     * For example: If subscribed to the topic `person/:id` and a message is published to the topic `person/5`,
     * the resolved id with the value `5` is contained in the params map.
     */
    params?: Map<string, string>;
}
/**
 * Declares headers set by the platform when sending a message.
 *
 * Clients are allowed to read platform-defined headers from a message.
 *
 * @category Messaging
 */
declare enum MessageHeaders {
    /**
     * Identifies the sending client instance of a message.
     * This header is set by the platform when publishing a message or intent.
     */
    ClientId = "\u0275CLIENT_ID",
    /**
     * Identifies the sending application of a message.
     * This header is set by the platform when publishing a message or intent.
     */
    AppSymbolicName = "\u0275APP_SYMBOLIC_NAME",
    /**
     * Unique identity of the message.
     * This header is set by the platform when publishing a message or intent.
     */
    MessageId = "\u0275MESSAGE_ID",
    /**
     * Destination to which to send a response to this message.
     * This header is set by the platform when sending a request.
     */
    ReplyTo = "\u0275REPLY_TO",
    /**
     * The time the message was sent.
     * This header is set by the platform when publishing a message or intent.
     */
    Timestamp = "\u0275TIMESTAMP",
    /**
     * The version of the client.
     */
    Version = "\u0275VERSION",
    /**
     * Use this header to set the request method to indicate the desired action to be performed for a given resource.
     * @see RequestMethods
     */
    Method = "\u0275METHOD",
    /**
     * Use this header to set the response status code to indicate whether a request has been successfully completed.
     * See {@link ResponseStatusCodes} for available status codes. Other codes are also allowed.
     *
     * Status codes are primarily used in request-reply communication. In request-response communication, by default,
     * the requestor’s Observable never completes. However, the replier can include the response status code in the reply’s
     * headers, allowing to control the lifecycle of the requestor’s Observable.
     *
     * For example, the status code {@link ResponseStatusCodes.TERMINAL 250} allows completing the requestor’s Observable
     * after emitted the reply, or the status code {@link ResponseStatusCodes.ERROR 500} to error the Observable.
     *
     * Note that the platform evaluates status codes only in request-response communication. They are ignored when observing
     * topics or intents in pub/sub communication but can still be used; however, they must be handled by the application,
     * e.g., by using the {@link throwOnErrorStatus} SCION RxJS operator.
     *
     * @see ResponseStatusCodes
     */
    Status = "\u0275STATUS"
}
/**
 * Defines a set of request methods to indicate the desired action to be performed for a given resource.
 *
 * @category Messaging
 */
declare enum RequestMethods {
    /**
     * The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
     */
    GET = "GET",
    /**
     * The DELETE method deletes the specified resource.
     */
    DELETE = "DELETE",
    /**
     * The PUT method replaces all current representations of the target resource with the request payload.
     */
    PUT = "PUT",
    /**
     * The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
     */
    POST = "POST",
    /**
     * The OBSERVE method is used to observe the specified resource.
     */
    OBSERVE = "OBSERVE"
}
/**
 * Defines a set of response status codes to indicate whether a request has been successfully completed.
 *
 * @see throwOnErrorStatus
 * @see MessageClient.request$
 * @see IntentClient.request$
 *
 * @category Messaging
 */
declare enum ResponseStatusCodes {
    /**
     * The request has succeeded.
     */
    OK = 200,
    /**
     * The request has succeeded. No further response to be expected.
     *
     * In request-reply communication, setting this status code will complete the requestor's Observable
     * after emitted the reply. The reply is only emitted if not `undefined`.
     */
    TERMINAL = 250,
    /**
     * The receiver could not understand the request due to invalid syntax.
     *
     * In request-reply communication, setting this status code will error the requestor's Observable.
     */
    BAD_REQUEST = 400,
    /**
     * The receiver could not find the requested resource.
     *
     * In request-reply communication, setting this status code will error the requestor's Observable.
     */
    NOT_FOUND = 404,
    /**
     * The receiver encountered an internal error. Optionally, set the error as message payload.
     *
     * In request-reply communication, setting this status code will error the requestor's Observable.
     */
    ERROR = 500
}
/**
 * Returns an Observable that mirrors the source Observable unless receiving a message with
 * a response status code greater than or equal to 400. Then, the stream will end with an
 * {@link RequestError error} and the source Observable unsubscribed.
 *
 * When receiving a message with the response status code {@link ResponseStatusCodes.TERMINAL},
 * the Observable emits this message and completes.
 *
 * If a message does not include a response status code, the message is emitted as is.
 *
 * Note that this operator is installed in {@link MessageClient.request$} and {@link IntentClient.request$}.
 *
 * @category Messaging
 */
declare function throwOnErrorStatus<BODY>(): MonoTypeOperatorFunction<TopicMessage<BODY>>;
/**
 * Maps each message to its body.
 *
 * @category Messaging
 */
declare function mapToBody<T>(): OperatorFunction<TopicMessage<T> | IntentMessage<T>, T>;
/**
 * Indicates that the request handler responded with an error response.
 *
 * @category Messaging
 */
declare class RequestError extends Error {
    status: number;
    msg: Message;
    constructor(error: string, status: number, msg: Message);
}

/**
 * Allows intercepting messages before their publication.
 *
 * An interceptor can reject or modify messages. Multiple interceptors can be registered, forming a chain in which each interceptor
 * is called one by one in registration order.
 *
 * For each message, the platform invokes the intercept method of the first registered interceptor, passing the message and the next
 * handler as arguments. By calling the next handler in the intercept method, message dispatching is continued. If there is no more
 * interceptor in the chain, the message is transported to the receivers, if any. But, if throwing an error in the intercept method,
 * message dispatching is aborted, and the error transported back to the sender.
 *
 * #### Registering Interceptors
 * You register interceptors with the bean manager when the host application starts. Interceptors can be registered only in the host
 * application. They are invoked in registration order.
 *
 * ```ts
 * Beans.register(MessageInterceptor, {useClass: MessageLoggerInterceptor, multi: true});
 * ```
 *
 * #### Filtering Messages for Interception
 * The platform passes all messages to the interceptors, including platform messages vital for its operation.
 * You can use the TopicMatcher to filter messages, allowing you to test whether a topic matches a pattern. The pattern must be a topic,
 * not a regular expression; thus, it must consist of one or more segments, each separated by a forward slash. The pattern can contain
 * wildcard segments. Wildcard segments start with a colon (:), acting act as a placeholder for any segment value.
 *
 * ```ts
 * class ProductValidatorInterceptor implements MessageInterceptor {
 *
 *   private topicMatcher = new TopicMatcher('product/:id');
 *
 *   public intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> {
 *     // Pass messages sent to other topics.
 *     if (!this.topicMatcher.match(message.topic).matches) {
 *       return next.handle(message);
 *     }
 *
 *     // Validate the payload of the message.
 *     if (isValid(message.body)) {
 *       return next.handle(message);
 *     }
 *
 *     throw Error('Message failed schema validation');
 *   }
 * }
 * ```
 *
 * @category Messaging
 */
declare abstract class MessageInterceptor implements Interceptor<TopicMessage, Handler<TopicMessage>> {
    /**
     * Intercepts a message before being published to its topic.
     *
     * Decide if to continue publishing by passing the message to the next handler, or to reject publishing by throwing an error,
     * or to swallow the message by not calling the next handler at all. If rejecting publishing, the error is transported to the
     * message publisher.
     *
     * Important: When passing the message to the next handler, either return its Promise or await it.
     * Otherwise, errors of subsequent interceptors would not be reported to the sender.
     *
     * @param  message - the message to be published to its topic
     * @param  next - the next handler in the chain; invoke its {@link Handler.handle} method to continue publishing.
     * @throws throw an error to reject publishing; the error is transported to the message publisher.
     */
    abstract intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void>;
}
/**
 * Allows intercepting intents before their publication.
 *
 * An interceptor can reject or modify intents. Multiple interceptors can be registered, forming a chain in which each interceptor
 * is called one by one in registration order.
 *
 * For each intent, the platform invokes the intercept method of the first registered interceptor, passing the intent and the next
 * handler as arguments. By calling the next handler in the intercept method, intent dispatching is continued. If there is no more
 * interceptor in the chain, the intent is transported to the receivers, if any. But, if throwing an error in the intercept method,
 * intent dispatching is aborted, and the error transported back to the sender.
 *
 * #### Registering Interceptors
 * You register interceptors with the bean manager when the host application starts. Interceptors can be registered only in the host
 * application. They are invoked in registration order.
 *
 * ```ts
 * Beans.register(IntentInterceptor, {useClass: IntentLoggerInterceptor, multi: true});
 * ```
 *
 * #### Filtering intents for Interception
 * The platform passes all intents to the interceptors. The interceptor must filter intents of interest.
 *
 * @category Messaging
 * @category Intention API
 */
declare abstract class IntentInterceptor implements Interceptor<IntentMessage, Handler<IntentMessage>> {
    /**
     * Intercepts an intent before being published.
     *
     * Decide if to continue publishing by passing the intent to the next handler, or to reject publishing by throwing an error,
     * or to swallow the intent by not calling the next handler at all. If rejecting publishing, the error is transported to
     * the intent issuer.
     *
     * Important: When passing the message to the next handler, either return its Promise or await it.
     * Otherwise, errors of subsequent interceptors would not be reported to the sender.
     *
     * @param  intent - the intent to be published
     * @param  next - the next handler in the chain; invoke its {@link Handler.handle} method to continue publishing.
     * @throws throw an error to reject publishing; the error is transported to the intent issuer.
     */
    abstract intercept(intent: IntentMessage, next: Handler<IntentMessage>): Promise<void>;
}
/**
 * Allows the interception of messages or intents before their publication.
 *
 * @see {@link MessageInterceptor}
 * @see {@link IntentInterceptor}
 * @category Messaging
 */
interface Interceptor<T, H extends Handler<T>> {
    intercept(message: T, next: H): Promise<void>;
}
/**
 * Represents a handler in the chain of interceptors.
 *
 * @category Messaging
 */
declare abstract class Handler<T> {
    /**
     * Invoke to continue the chain with the given message.
     */
    abstract handle(message: T): Promise<void>;
}

/**
 * Hook to intercept the host manifest before it is registered in the platform.
 *
 * If integrating the platform in a library, you may need to intercept the manifest of the host in order to introduce library-specific behavior.
 *
 * You can register the interceptor in the bean manager, as follows:
 *
 * ```ts
 * Beans.register(HostManifestInterceptor, {useClass: YourInterceptor, multi: true});
 * ```
 *
 * The interceptor may look as following:
 * ```ts
 *  class YourInterceptor implements HostManifestInterceptor {
 *
 *   public intercept(hostManifest: Manifest): void {
 *     hostManifest.intentions = [
 *       ...hostManifest.intentions || [],
 *       provideMicrofrontendIntention(),
 *     ];
 *     hostManifest.capabilities = [
 *       ...hostManifest.capabilities || [],
 *       provideMessageBoxCapability(),
 *     ];
 *   }
 * }
 *
 * function provideMicrofrontendIntention(): Intention {
 *    return {
 *      type: 'microfrontend',
 *      qualifier: {'*': '*'},
 *    };
 *  }
 *
 * function provideMessageBoxCapability(): Capability {
 *    return {
 *      type: 'messagebox',
 *      qualifier: {},
 *      private: false,
 *      description: 'Allows displaying a simple message to the user.',
 *    };
 *  }
 *
 * ```
 *
 * @category Platform
 * @category Intention API
 */
declare abstract class HostManifestInterceptor {
    /**
     * Allows modifying the host manifest before it is registered in the platform, e.g., to register capabilities or intentions.
     */
    abstract intercept(hostManifest: Manifest): void;
}

/**
 * Controls how to connect to the platform host.
 *
 * @category Platform
 */
interface ConnectOptions {
    /**
     * Controls whether to actually connect to the platform host.
     *
     * Disabling this flag can be useful in tests to not connect to the platform host but still have platform beans available.
     * In this mode, messaging is disabled, i.e., sending and receiving messages results in a NOOP.
     *
     * By default, this flag is set to `true`.
     */
    connect?: boolean;
    /**
     * Specifies the maximum time (in milliseconds) to wait until the message broker is discovered on platform startup. If the broker is not discovered within
     * the specified time, platform startup fails with an error. By default, a timeout of 10s is used.
     */
    brokerDiscoverTimeout?: number;
    /**
     * Specifies the maximum time (in milliseconds) that the platform waits to receive dispatch confirmation for messages sent by this application until rejecting
     * the publishing Promise. By default, a timeout of 10s is used.
     */
    messageDeliveryTimeout?: number;
}

/**
 * Central point for a microfrontend to connect to the platform host in order to interact with the platform and other microfrontends.
 * This class cannot be instantiated. All functionality is provided by static methods.
 *
 * @see MicrofrontendPlatform
 * @see MicrofrontendPlatformHost
 * @see MicrofrontendPlatformClient
 *
 * @category Platform
 * @category Lifecycle
 */
declare class MicrofrontendPlatformClient {
    private constructor();
    /**
     * Connects this microfrontend to the platform host.
     *
     * A microfrontend should connect to the platform host during application bootstrapping. In Angular, for example, this is typically
     * done in an app initializer. Since connecting to the platform host is an asynchronous operation, the microfrontend should wait
     * for the Promise to resolve before interacting with the platform or other microfrontends.
     *
     * The platform connects to the host through its window hierarchy. Therefore, the microfrontend must be embedded as direct or
     * indirect child window of the host application window.
     *
     * @param  symbolicName - Specifies the symbolic name of the application of this microfrontend. The application must be registered
     *         in the platform host under this symbol.
     * @param  connectOptions - Controls how to connect to the platform host.
     * @return Promise that resolves when successfully connected to the platform host, or that rejects otherwise, e.g., if not allowed
     *         to connect because not registered.
     */
    static connect(symbolicName: string, connectOptions?: ConnectOptions): Promise<void>;
    /**
     * Tests whether this microfrontend is connected to the platform host.
     */
    static isConnected(): Promise<boolean>;
    /**
     * Signals readiness to notify the platform that the microfrontend has completed initialization.
     *
     * When navigating to the microfrontend with `OutletRouter.navigate('path/to/microfrontend', {showSplash: true})`,
     * a splash is displayed until the microfrontend signals readiness.
     *
     * @see SciRouterOutletElement
     * @see NavigationOptions.showSplash
     */
    static signalReady(): void;
}

/**
 * Represents the minimum size that will allow the element to display normally.
 *
 * @category Preferred Size
 */
interface PreferredSize {
    minWidth?: string;
    width?: string;
    maxWidth?: string;
    minHeight?: string;
    height?: string;
    maxHeight?: string;
}

/**
 * Web component that allows embedding web content using the {@link OutletRouter}. The content is displayed inside
 * an iframe to achieve the highest possible level of isolation between the microfrontends via a separate browsing context.
 *
 * To embed a microfrontend, place this custom HMTL element `<sci-router-outlet></sci-router-outlet>` in an HTML
 * template, give it a name via its `name` attribute and navigate via {@link OutletRouter} to instruct the outlet to
 * load the microfrontend.
 *
 * 1. Place the web component in an HTML template:
 * ```html
 * <sci-router-outlet name="detail"></sci-router-outlet>
 * ```
 *
 * 2. Control the outlet's content:
 * ```ts
 * Beans.get(OutletRouter).navigate('https://micro-frontends.org', {outlet: 'detail'});
 * ```
 *
 * Outlets can be nested, allowing a microfrontend to embed another microfrontend. There is no limit to the number of
 * nested outlets. However, be aware that nested content is loaded cascaded, that is, only loaded once its parent content
 * finished loading.
 *
 * When adding the outlet to the DOM, the outlet displays the last URL routed for it, if any. When repeating routing for
 * an outlet, its content is replaced.
 *
 * ***
 *
 * ### Outlet Context
 * The router outlet allows associating contextual data, which then is available to embedded content at any nesting level.
 * Data must be serializable with the structured clone algorithm. Embedded content can look up contextual data using the
 * {@link ContextService}. Typically, contextual data is  used to provide microfrontends with information about their embedding
 * environment. Looking up contextual data requires the embedded microfrontend to be a registered micro application.
 *
 * Each outlet spans a new context. A context is like a `Map` with key-value entries. Contexts form a hierarchical tree structure.
 * When looking up a value and if the value is not found in the current context, the lookup is retried on the parent context,
 * repeating until either a value is found, or the root of the context tree has been reached.
 *
 * You can set contextual data as following:
 * ```ts
 *  const outlet: SciRouterOutletElement = document.querySelector('sci-router-outlet');
 *  outlet.setContextValue('key', 'value');
 * ```
 *
 * Embedded content can look up contextual data as following:
 * ```ts
 * Beans.get(ContextService).observe$('key').subscribe(value => {
 *   ...
 * });
 * ```
 *
 * ### Outlet size
 * The router outlet can adapt its size to the preferred size of its embedded content. The preferred size is set by the microfrontend embedded
 * in the router outlet, which, therefore, requires the embedded microfrontend to be connected to the platform.
 *
 * Embedded content can report its preferred size using the {@link PreferredSizeService}, causing the outlet to adapt its size.
 *
 * ### Keystroke Bubbling
 * The router outlet allows the registration of keystrokes, instructing embedded content at any nesting level to propagate corresponding keyboard events
 * to this outlet. The outlet dispatches keyboard events for registered keystrokes as synthetic keyboard events via its event dispatcher. They bubble up
 * the DOM tree like regular events. Propagated events are of the original type, meaning that when the user presses a key on the keyboard, a `keydown`
 * keyboard event is dispatched, or a `keyup` event when releasing a key, respectively. Keystroke bubbling requires the embedded microfrontend to be a
 * registered micro application.
 *
 * A keystroke is a `string` that has several parts, each separated with a dot. The first part specifies the event type (`keydown` or `keyup`), followed
 * by optional modifier part(s) (`alt`, `shift`, `control`, `meta`, or a combination thereof) and with the keyboard key as the last part. The key is a
 * case-insensitive value of the `KeyboardEvent.key` property. Two keys are an exception to the value of the `KeyboardEvent.key` property: `dot` and `space`.
 * For a complete list of valid key values, see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.
 *
 * You can register keystrokes via the `keystrokes` attribute in the HTML template, or via the `keystrokes` property on the DOM
 * element. If setting keystrokes via the HTML template, multiple keystrokes are separated by a comma.
 *
 * If you want to prevent the default action of a keystroke, add the `preventDefault` flag. If not specifying the flag, the default action won't be prevented.
 *
 * HTML template:
 * ```html
 * <sci-router-outlet keystrokes="keydown.control.alt.enter{preventDefault=true},keydown.escape,keydown.control.space"></sci-router-outlet>
 * ```
 *
 * Alternatively, you can register keystrokes on the DOM element as shown below.
 *
 * TypeScript:
 * ```ts
 *  const outlet: SciRouterOutletElement = document.querySelector('sci-router-outlet');
 *  outlet.keystrokes = [
 *      'keydown.control.alt.enter{preventDefault=true}',
 *      'keydown.escape',
 *      'keydown.control.space'
 *  ];
 * ```
 *
 * ### Scrollable Content
 * By default, page scrolling is enabled for the embedded content, displaying a scrollbar when it overflows. If disabled, overflowing content is clipped,
 * unless the embedded content uses a viewport, or reports its preferred size to the outlet.
 *
 * The below code snippet illustrates how to disable page scrolling for the embedded content.
 * ```html
 * <sci-router-outlet scrollable="false"></sci-router-outlet>
 * ```
 *
 * ### Router Outlet Events
 *
 * The router outlet emits the following events as custom DOM events. You can attach an event listener declaratively in the HTML template using the `onevent`
 * handler syntax, or programmatically using the `addEventListener` method.
 *
 * - `activate`
 *   The `activate` custom DOM event is fired when a microfrontend is mounted. It contains the URL of the mounted microfrontend in its `details` property as `string`
 *   value. The microfrontend may not be fully loaded yet.
 * - `deactivate`
 *   The `deactivate` custom DOM event is fired when a microfrontend is about to be unmounted. It contains the URL of the unmounted microfrontend in its `details`
 *   property as `string` value.
 * - `focuswithin`
 *   The `focuswithin` custom DOM event is fired when the microfrontend loaded into the outlet, or any of its child microfrontends, has gained or lost focus.
 *   It contains the current focus-within state in its `details` property as a `boolean` value: `true` if focus was gained, or `false` if focus was lost.
 *   The event does not bubble up through the DOM. After gaining focus, the event is not triggered again until embedded content loses focus completely, i.e.,
 *   when focus does not remain in the embedded content at any nesting level. This event behaves like the `:focus-within` CSS pseudo-class but operates across iframe
 *   boundaries. For example, it can be useful when implementing overlays that close upon focus loss.
 *
 *   Note that SCION can only monitor microfrontends of registered micro apps that are connected to the platform.
 *
 * Usage:
 *
 * ```html
 * <sci-router-outlet onfocuswithin="onFocusWithin()"></sci-router-outlet>
 * ```
 *
 * For an Angular application, it would look as follows:
 * ```html
 * <sci-router-outlet (focuswithin)="onFocusWithin($event)"></sci-router-outlet>
 * ```
 *
 * ### Splash
 *
 * Loading and bootstrapping a microfrontend can take some time, at worst, only displaying content once initialized.
 *
 * To indicate the loading of a microfrontend, the navigator can instruct the router outlet to display a splash until the microfrontend signals readiness.
 *
 * ```ts
 * Beans.get(OutletRouter).navigate('path/to/microfrontend', {showSplash: true});
 * ```
 *
 * The splash is the markup between the opening and closing tags of the router outlet element.
 *
 * ```html
 * <sci-router-outlet>
 *   Loading...
 * </sci-router-outlet>
 * ```
 *
 * The splash is displayed until the embedded microfrontend signals readiness.
 *
 * ```ts
 * MicrofrontendPlatformClient.signalReady();
 * ```
 *
 * #### Layouting the Splash
 *
 * To lay out the content of the splash use the pseudo-element selector `::part(splash)`.
 *
 * Example of centering splash content in a CSS grid container:
 * ```css
 * sci-router-outlet::part(splash) {
 *   display: grid;
 *   place-content: center;
 * }
 * ```
 *
 * ### Web component
 * The outlet is registered as a custom element in the browser's custom element registry as defined by the Web Components standard.
 * See https://developer.mozilla.org/en-US/docs/Web/Web_Components for more information.
 *
 * ### Miscellaneous
 * If no content is routed for display in the router outlet, the CSS class `sci-empty` is added to the outlet. An outlet will not display content if
 * either there has not yet been any navigation for the outlet or the outlet content has been cleared.
 *
 * @see {@link OutletRouter}
 * @see {@link PreferredSizeService}
 * @see {@link ContextService}
 *
 * @category Routing
 */
declare class SciRouterOutletElement extends HTMLElement {
    private _shadowRoot;
    private _disconnect$;
    private _uid;
    private _iframe;
    private _outletName$;
    private _contextProvider;
    private _empty$;
    private _splash;
    /**
     * Emits whether content is routed for display in this router outlet.
     * Upon subscription, the Observable emits the current empty state, and then continuously emits when it changes. It never completes.
     *
     * An outlet does not display content if no navigation has taken place yet, or if the outlet content has been cleared.
     */
    readonly empty$: Observable<boolean>;
    constructor();
    /**
     * Sets the name of this outlet.
     *
     * By giving the outlet a name, you can reference the outlet when navigating. The name is optional;
     * if not set, it defaults to {@link PRIMARY_OUTLET primary}
     */
    set name(name: string | undefined);
    /**
     * Returns the name of this outlet.
     */
    get name(): string | undefined;
    /**
     * Specifies whether to enable or disable native page scrolling in the embedded document.
     *
     * By default, page scrolling is enabled for the embedded content, displaying a scrollbar when it overflows.
     * If disabled, overflowing content is clipped, unless the embedded content uses a viewport, or reports
     * its preferred size to the outlet.
     */
    set scrollable(scrollable: boolean);
    /**
     * Returns whether the embedded document is natively page scrollable.
     */
    get scrollable(): boolean;
    /**
     * Instructs embedded content at any nesting level to propagate keyboard events to this outlet. The outlet dispatches keyboard events for registered
     * keystrokes as synthetic keyboard events via its event dispatcher. They bubble up the DOM tree like regular events. Propagated events are of the
     * original type, meaning that when the user presses a key on the keyboard, a `keydown` keyboard event is dispatched, or a `keyup` event when releasing
     * a key, respectively.
     *
     * @param keystrokes - A keystroke is specified as a string that has several parts, each separated with a dot. The first part specifies the event type
     *                   (`keydown` or `keyup`), followed by optional modifier part(s) (`alt`, `shift`, `control`, `meta`, or a combination thereof) and
     *                   with the keyboard key as the last part. The key is a case-insensitive value of the `KeyboardEvent#key` property. For a complete
     *                   list of valid key values, see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values. Two keys are an
     *                   exception to the value of the `KeyboardEvent#key` property: `dot` and `space`.
     *                   <br>
     *                   To prevent the default action of a keystroke, the `preventDefault` flag can be added.
     *                   <br>
     *                   Examples: `keydown.control.z{preventDefault=true}`, `keydown.escape`, `keyup.enter`, `keydown.control.alt.enter`, `keydown.control.space`.
     */
    set keystrokes(keystrokes: string[]);
    /**
     * Returns the keystrokes which to bubble across the iframe boundaries.
     */
    get keystrokes(): string[];
    /**
     * Makes contextual data available to embedded content. Embedded content can lookup contextual data using the {@link ContextService}.
     * Contextual data must be serializable with the structured clone algorithm.
     */
    setContextValue<T = unknown>(name: string, value: T): void;
    /**
     * Removes data registered under the given key from the context.
     *
     * Removal does not affect parent contexts, so it is possible that a subsequent call to {@link ContextService.observe$} with the same name
     * will return a non-null result, due to a value being stored in a parent context.
     *
     * @return `true` if removed the value from the outlet context; otherwise `false`.
     */
    removeContextValue(name: string): boolean;
    /**
     * Returns an Observable that emits the context of this outlet. Context values inherited from parent contexts are not returned.
     * The Observable never completes, and emits when a context value is added to or removed from the outlet context.
     */
    get contextValues$(): Observable<Map<string, unknown>>;
    /**
     * Resets the preferred size which may have been set by the embedded content.
     */
    resetPreferredSize(): void;
    /**
     * Returns the preferred size, if any, or `undefined` otherwise.
     */
    get preferredSize(): PreferredSize | undefined;
    /**
     * Returns the reference to the iframe of this outlet.
     */
    get iframe(): HTMLIFrameElement;
    private installOutletContext;
    private installOutletUrlListener;
    private installPreferredSizeListener;
    /**
     * Dispatches synthetic keyboard events that bubble up the DOM like regular events.
     * Note that synthetic events have the `isTrusted` flag set to `false`, preventing them of triggering default actions.
     *
     * Therefore, if default actions should be prevented, it has to be done where the original event is listened to.
     * @see KeyboardEventDispatcher
     *
     * For more information about trusted events
     * @see https://www.w3.org/TR/DOM-Level-3-Events/#trusted-events
     * @see https://www.chromestatus.com/features#istrusted
     */
    private installKeyboardEventDispatcher;
    private installFocusWithinEventDispatcher;
    private installHostElementDecorator;
    /**
     * Disposes the splash when receiving a readiness signal of the embedded microfrontend.
     */
    private installSplashDisposer;
}
/**
 * Information about the outlet which embeds a microfrontend.
 *
 * This object can be obtained from the {@link ContextService} using the name {@link OUTLET_CONTEXT}.
 *
 * ```ts
 * Beans.get(ContextService).observe$(OUTLET_CONTEXT).subscribe((outletContext: OutletContext) => {
 *   ...
 * });
 * ```
 *
 * @see {@link OUTLET_CONTEXT}
 * @see {@link ContextService}
 * @category Context
 */
interface OutletContext {
    name: string;
    uid: string;
}
/**
 * Key for obtaining the current outlet context using {@link ContextService}.
 *
 * @category Context
 * @see {@link OutletContext}
 * @see {@link ContextService}
 */
declare const OUTLET_CONTEXT = "\u0275OUTLET";
/**
 * Default name for an outlet if no explicit name is specified.
 * @category Routing
 */
declare const PRIMARY_OUTLET = "primary";

/**
 * Options to control outlet navigation.
 *
 * @category Routing
 */
interface NavigationOptions {
    /**
     * Specifies the routing target. If not specifying an outlet and if navigating in the context of an outlet, that outlet will be used as the
     * navigation target, or the {@link PRIMARY_OUTLET primary} outlet otherwise.
     */
    outlet?: string;
    /**
     * Instructs the router outlet to show a splash, such as a skeleton or loading indicator, until the microfrontend signals readiness.
     * The splash is the markup between the opening and closing tags of the router outlet element.
     *
     * This flag is ignored when navigating by intent as specified by the microfrontend capability in {@link MicrofrontendCapability.properties.showSplash}.
     *
     * @see SciRouterOutletElement
     * @see MicrofrontendPlatformClient.signalReady
     */
    showSplash?: boolean;
    /**
     * Specifies the base URL to resolve a relative url. If not specified, the current window location is used to resolve a relative path.
     *
     * Note that this property has no effect if navigating via intent.
     */
    relativeTo?: string;
    /**
     * Specifies the parameters that, if navigating via URL, are used to substitute named URL parameters or that are passed along with the intent
     * if navigating via intent.
     */
    params?: Map<string, unknown> | Dictionary;
    /**
     * Instructs the router to push a state to the browser's session history stack, allowing the user to use the back button to navigate back in the outlet.
     * By default, this behavior is disabled.
     */
    pushStateToSessionHistoryStack?: boolean;
    /**
     * Reference to the microfrontend capability when navigating via intent.
     * Internal property used by the router outlet to determine if to ignore the `showSplash` instruction when navigating to the same microfrontend capability again.
     * @ignore
     */
    ɵcapabilityId?: string;
}
/**
 * Represents a navigation.
 *
 * @category Routing
 */
interface Navigation {
    /**
     * The URL where to navigate to.
     */
    url: string;
    /**
     * If `true`, adds a state to the browser's session history stack.
     */
    pushStateToSessionHistoryStack?: boolean;
    /**
     * If `true`, instructs the router outlet to show a splash, such as a skeleton or loading indicator,
     * until the microfrontend signals readiness.
     *
     * @see SciRouterOutletElement
     * @see MicrofrontendPlatformClient.signalReady
     */
    showSplash?: boolean;
    /**
     * The microfrontend capability when navigating via intent.
     */
    capabilityId?: string;
}

/**
 * Allows navigating to a web page or microfrontend in a {@link SciRouterOutletElement `<sci-router-outlet>`} element.
 *
 * In SCION Microfrontend Platform, routing means instructing a `<sci-router-outlet>` to display the content of a URL. Routing works
 * across microfrontend and micro application boundaries, allowing the URL of an outlet to be set from anywhere in the application. The
 * web content displayed in an outlet can be any HTML document that has not set the HTTP header X-Frame-Options. Routing is also referred
 * to as navigating.
 *
 * The router supports multiple outlets in the same application to co-exist. By giving an outlet a name, you can reference it as the
 * routing target. If not naming an outlet, its name defaults to {@link PRIMARY_OUTLET primary}. If multiple outlets have the same name,
 * they all show the same content. If routing in the context of a router outlet, that is inside a microfrontend, and not specifying a
 * routing target, the content of the current outlet is replaced.
 *
 * An outlet does not necessarily have to exist at the time of routing. When adding the outlet to the DOM, the outlet displays the last URL
 * routed for it. When repeating routing for an outlet, its content is replaced.
 *
 * A router outlet is defined as follows. If no navigation has been performed for the outlet yet, then its content is empty.
 *
 *  ```html
 * <sci-router-outlet name="aside"></sci-router-outlet>
 * ```
 *
 * ### Navigation via URL
 * The URL of the page to be loaded into the router outlet is passed to the router, as follows:
 *
 * ```ts
 * Beans.get(OutletRouter).navigate('https://micro-frontends.org', {outlet: 'aside'});
 * ```
 *
 * #### Relative URL Navigation
 * The router allows to use both absolute and relative paths. A relative path begins with a navigational symbol `/`, `./`, or `../`. By default,
 * relative navigation is relative to the current window location of the navigating application, unless specifying a base path for the navigation.
 *
 * ```ts
 * // Navigation relative to the root path segment
 * Beans.get(OutletRouter).navigate('/products/:id', {outlet: PRIMARY_OUTLET});
 *
 * // Navigation relative to the parent path segment
 * Beans.get(OutletRouter).navigate('../products/:id', {outlet: PRIMARY_OUTLET});
 * ```
 *
 * #### Named URL Parameters
 * The URL being passed to the router can contain named parameters which the router replaces with values of the provided params object.
 * A named parameter begins with a colon (`:`) and is allowed in path segments, query parameters, matrix parameters and the fragment part,
 * e.g., `product/:id` or `product;id=:id` or `products?id=:id`.
 *
 * ### Navigating via Intent
 * As an alternative to navigating directly to a URL, the router supports navigation to a microfrontend capability via an intent.
 * We refer to this as intent-based routing.
 *
 * We recommend using intent-based routing over url-based routing, especially for cross-application navigations, since the navigation flows
 * are explicit, i.e., declared in the manifest, and to keep the microfrontend URLs an implementation detail of the micro applications that
 * provide the microfrontends.
 *
 * Note that if the microfrontend is provided by another micro app, the navigating app must manifest an intention. Also, the navigating
 * app can only navigate to public microfrontend capabilities.
 *
 * The following code snippet illustrates how to display the _product_ microfrontend in the "aside" outlet. Note that you only need to pass
 * the qualifier of the microfrontend capability and not its type. The capability type, which is always `microfrontend`, is implicitly set
 * by the router.
 *
 * ```ts
 * Beans.get(OutletRouter).navigate({entity: 'product'}, {
 *   outlet: 'aside',
 *   params: {id: 123},
 * });
 * ```
 *
 * Applications can provide microfrontend capabilities through their manifest. A microfrontend can be either application private or exposed to
 * other micro applications. The platform requires all microfrontend capabilities to be of type `microfrontend`. A particular microfrontend can
 * be identified using its qualifier.
 *
 * ```json
 * {
 *   "type": "microfrontend",
 *   "qualifier": {
 *     "entity": "product"
 *   },
 *   "description": "Displays a product.",
 *   "params": [
 *     {"name": "id", "required": true}
 *   ],
 *   "private": false,
 *   "properties": {
 *     "path": "product/:id",
 *   }
 * }
 * ```
 *
 * Note that the providing micro application does not need to install an intent handler for its microfrontend capabilities. The platform intercepts
 * microfrontend intents and performs the navigation.
 *
 * ### Persistent Navigation
 * Persistent navigation refers to the mechanism for restoring the navigational state after an application reload.
 *
 * The router does not provide an implementation for persistent navigation out-of-the-box, mostly because many persistence strategies are imaginable.
 * For example, the navigational state could be added to the top-level URL, stored in local storage, or persisted in the backend.
 * However, you can easily implement persistent navigation yourself. The router publishes navigations to the topic `sci-router-outlets/:outlet/url`;
 * thus, they can be captured and persisted. When starting the application, you can then replay persisted navigations using the router.
 *
 * ### Unloading Outlet Content
 * To unload an outlet’s content, use null as the URL when routing, as follows:
 *
 * ```ts
 * Beans.get(OutletRouter).navigate(null, {outlet: 'aside'});
 * ```
 *
 * ### Browsing History and Session History
 * Routing does not add an entry to the browsing history, and, by default, not push a navigational state to the browser’s session history stack.
 *
 * You can instruct the router to add a navigational state to the browser’s session history stack, allowing the user to use the back button of the browser to
 * navigate back in an outlet.
 *
 * ```ts
 * Beans.get(OutletRouter).navigate('https://micro-frontends.org', {
 *   outlet: 'aside',
 *   pushStateToSessionHistoryStack: true,
 * });
 * ```
 *
 * @see {@link SciRouterOutletElement}
 *
 * @category Routing
 */
declare class OutletRouter {
    /**
     * Navigates to the passed URL.
     *
     * If not specifying an outlet and if navigating in the context of an outlet, that outlet will be used as the navigation target,
     * or the {@link PRIMARY_OUTLET primary} outlet otherwise.
     *
     * @param  url - Specifies the URL of the page to be loaded into the router outlet. To clear the outlet, pass `null` as the URL.
     *         The URL allows the use of navigational symbols and named parameters. A named parameter begins with a colon (`:`)
     *         and is allowed in path segments, query parameters, matrix parameters and the fragment part. Named parameters
     *         are replaced with values passed via {@link NavigationOptions#params}. Named query and matrix parameters without
     *         a replacement are removed.
     *         Examples:
     *         - `product/:id` // named path parameter
     *         - `product;id=:id` // named matrix parameter
     *         - `products?id=:id` // named query parameter
     * @param  options - Instructs the router how to navigate, for example, you can specify the router outlet or pass named parameter values for substitution.
     * @return Promise that resolves when navigated, or that rejects otherwise.
     */
    navigate(url: string | null, options?: NavigationOptions): Promise<void>;
    /**
     * Navigates to the microfrontend provided as {@link MicrofrontendCapability} matching the passed qualifier.
     *
     * We recommend using intent-based routing over url-based routing, especially for cross-application navigations, since the navigation flows are
     * explicit, i.e., declared in the manifest, and to keep the microfrontend URLs an implementation detail of the micro applications that provide
     * the microfrontends.
     *
     * If the microfrontend is provided by another micro app, the navigating app must manifest an intention. Also, the navigating app can only navigate
     * to public microfrontend capabilities.
     *
     * If not specifying an outlet and if navigating in the context of an outlet, that outlet will be used as the navigation target,
     * or the {@link PRIMARY_OUTLET primary} outlet otherwise.
     *
     * @param  qualifier - Qualifies the microfrontend which to load into the outlet.
     * @param  options - Instructs the router how to navigate, for example, you can specify the router outlet or pass intent parameters.
     * @return Promise that resolves when navigated, or that rejects otherwise.
     */
    navigate(qualifier: Qualifier, options?: NavigationOptions): Promise<void>;
    /**
     * Navigates to specified URL.
     */
    private navigateByUrl;
    /**
     * Navigates to a microfrontend available as {@link MicrofrontendCapability} matching the passed qualifier.
     */
    private navigateByIntent;
    private computeNavigationUrl;
    private resolveContextualOutlet;
    /**
     * Replaces named parameters in the given path with values contained in the given {@link Map}.
     * Named parameters begin with a colon (`:`) and are allowed in path segments, query parameters, matrix parameters
     * and the fragment part.
     *
     * Empty query and matrix params are removed, but not empty path params.
     *
     * Some examples about the usage of named parameters:
     * /segment/:param1/segment/:param2 // path params
     * /segment/segment;matrixParam1=:param1;matrixParam2=:param2 // matrix params
     * /segment/segment?queryParam1=:param1&queryParam2=:param2 // query params
     */
    private substituteNamedParameters;
}

/**
 * Used by {@link OutletRouter} to convert relative paths to absolute paths.
 *
 * Replace this bean to use a different relative path resolution strategy.
 *
 * @see {@link OutletRouter}
 * @category Routing
 */
declare class RelativePathResolver {
    /**
     * Converts the given relative path into a navigable URL with relative navigational symbols like `/`, `./`, or `../` resolved.
     *
     * @param  path - Specifies the path which to convert into an absolute path.
     * @param  options - Specifies to which url the given path is relative to.
     * @return the absolute path.
     */
    resolve(path: string, options: {
        relativeTo: string;
    }): string;
}

/**
 * Assigns a URL to the iframe of a {@link SciRouterOutletElement `<sci-router-outlet>`}.
 *
 * @category Routing
 */
declare class RouterOutletUrlAssigner {
    /**
     * Assigns a URL to the iframe of a {@link SciRouterOutletElement `<sci-router-outlet>`}.
     *
     * @param iframe - Iframe for which to set the URL.
     * @param currNavigation - Current navigation.
     * @param prevNavigation - Previous navigation, if any.
     */
    assign(iframe: HTMLIFrameElement, currNavigation: Navigation, prevNavigation: Navigation | null): void;
}

/**
 * Instructs how to look up context values.
 *
 * @category Context
 */
interface ContextLookupOptions {
    /**
     * Controls whether to collect the most specific context value or to collect all values in the context
     * hierarchy that are associated with a context name. Defaults to `false` if not specified.
     *
     * If `true`, collects all values in the context hierarchy that are associated with the context name.
     * Collected values are returned as an array in context-descending order, i.e., values of parent contexts
     * come after values of child contexts.
     *
     * If `false`, the most specific context value is returned, i.e., the value of the closest context
     * that has a value associated with that name.
     */
    collect?: boolean;
}

/**
 * Allows looking up contextual data set on a {@link SciRouterOutletElement `<sci-router-outlet>`} at any parent level.
 *
 * The platform allows associating contextual data with an outlet, which then is available in embedded content using {@link ContextService}.
 * Contextual data must be serializable with the structured clone algorithm.
 *
 * Each outlet spans a new context. A context is similar to a `Map`, but is linked to its parent outlet context, if any, thus forming a hierarchical tree structure.
 * When looking up a value and if the value is not found in the outlet context, the lookup is retried on the parent context, repeating until either a value
 * is found or the root of the context tree has been reached.
 *
 * The platform sets the following context values by default:
 *
 * | Key | Value type | Description |
 * |-----|------------|-------------|
 * | {@link OUTLET_CONTEXT ɵOUTLET} | {@link OutletContext} | Information about the outlet which embeds the microfrontend. |
 * | {@link ACTIVATION_CONTEXT ɵACTIVATION_CONTEXT} | {@link ActivationContext} | Information about the activation context if loaded by an activator. See {@link ActivatorCapability} for more information about activators. |
 *
 *
 * @category Context
 */
declare class ContextService implements PreDestroy {
    private _destroy$;
    private _contextTreeChange$;
    private _whenContextTreeChangeListenerInstalled;
    constructor();
    /**
     * Observes the context value associated with the given name.
     *
     * The Observable emits the most specific value, i.e., the value of the closest context that has a value associated with that name.
     * To collect all values in the context hierarchy associated with that name, set {@link ContextLookupOptions#collect} to `true`.
     *
     * If not finding a value associated with the given name in the current context, the lookup is retried on the parent context, repeating
     * until either a value is found or the root of the context tree has been reached. If not finding a value in any context, the Observable
     * emits `null`.
     *
     * @param  name - The name of the context value to observe.
     * @param  options - Instructs how to look up the context value.
     * @return An Observable that emits the value associated with the given name, or `null` if not finding a value.
     *         Upon subscription, the Observable emits the currently associated value, and then continuously when it changes, at any level
     *         in the context tree. It never completes.
     */
    observe$<T>(name: string, options?: ContextLookupOptions & {
        collect: false;
    }): Observable<T | null>;
    /**
     * Observes the context values associated with the given name.
     *
     * The Observable emits all associated values in the context tree as array in context-descending order,
     * i.e., more specific context values precede others, in other words, values of child contexts precede values of parent contexts.
     * If not finding a value in any context, the Observable emits an empty array.
     *
     * To only obtain the most specific value, i.e., the value of the closest context that has a value associated with that name,
     * set {@link ContextLookupOptions#collect} to `false`.
     *
     * @param  name - The name of the context values to observe.
     * @param  options - Instructs how to look up context values.
     * @return An Observable that emits the values associated with the given name, or an empty array if not finding a value.
     *         Upon subscription, the Observable emits currently associated values, and then continuously when they change.
     *         It never completes. Collected values are emitted as array in context-descending order, i.e., more specific
     *         context values precede others, in other words, values of child contexts precede values of parent contexts.
     */
    observe$<T>(name: string, options: ContextLookupOptions & {
        collect: true;
    }): Observable<T[]>;
    observe$<T>(name: string, options?: ContextLookupOptions): Observable<T | T[] | null>;
    /**
     * Looks up the context value associated with the given name.
     *
     * The Promise resolves to the most specific value, i.e., the value of the closest context that has a value associated with that name.
     * To collect all values in the context hierarchy associated with that name, set {@link ContextLookupOptions#collect} to `true`.
     *
     * If not finding a value associated with the given name in the current context, the lookup is retried on the parent context, repeating
     * until either a value is found or the root of the context tree has been reached. If not finding a value in any context, the returned
     * Promise resolves to `null`.
     *
     * @param  name - The name of the context value to look up.
     * @param  options - Instructs how to look up the context value.
     * @return A Promise that resolves to the value associated with the given name, or `null` if not finding a value.
     */
    lookup<T>(name: string, options?: ContextLookupOptions & {
        collect: false;
    }): Promise<T | null>;
    /**
     * Looks up context values associated with the given name.
     *
     * The Promise resolves to all associated values in the context tree as array in context-descending order,
     * i.e., more specific context values precede others, in other words, values of child contexts precede values of parent contexts.
     * If not finding a value in any context, the Promise resolves to an empty array.
     *
     * To only obtain the most specific value, i.e., the value of the closest context that has a value associated with that name,
     * set {@link ContextLookupOptions#collect} to `false`.
     *
     * @param  name - The name of the context values to look up.
     * @param  options - Instructs how to look up context values.
     * @return A Promise that resolves to the values associated with the given name, or an empty array if not finding a value.
     *         Collected values are sorted in context-descending order, i.e., more specific context values precede others, in
     *         other words, values of child contexts precede values of parent contexts.
     */
    lookup<T>(name: string, options: ContextLookupOptions & {
        collect: true;
    }): Promise<T[]>;
    lookup<T>(name: string, options?: ContextLookupOptions): Promise<T | T[] | null>;
    /**
     * Checks if a context value is associated with the given name at any level in the context tree.
     *
     * @param name - The name of the context value to check if present.
     * @return A Promise that resolves to `true` if a context value is associated with the given name, or that resolves to `false` otherwise.
     */
    isPresent(name: string): Promise<boolean>;
    /**
     * Observes the names of context values registered at any level in the context tree.
     *
     * @return An Observable that emits the names of context values registered at any level in the context tree.
     *         Upon subscription, it emits the names of context values currently registered, and then it emits whenever
     *         some value is registered or unregistered from a context. The Observable never completes.
     */
    names$(): Observable<Set<string>>;
    /**
     * Looks up the context tree for a value associated with the given name.
     *
     * @param  name - The name of the value to return.
     * @param  options - Options to control context lookup.
     * @return An Observable that emits the context value associated with the given key and then completes.
     *         When the requested value is not found in a context, the Observable emits `null` and then completes.
     */
    private lookupContextValue$;
    /**
     * Looks up the context names of all values registered in the current and parent contexts.
     *
     * @return An Observable that emits the names of all values registered in the current and parent contexts and then completes.
     */
    private lookupContextNames$;
    /**
     * Installs a listener to get notified about context changes at any level in the context tree.
     *
     * @return A Promise that resolves when installed the listener.
     */
    private installContextTreeChangeListener;
    /** @ignore */
    preDestroy(): void;
}

/**
 * Allow observing whether the current microfrontend has received focus or contains embedded web content that has received focus.
 *
 * @category Focus
 */
declare class FocusMonitor {
    /**
     * Observable that emits when the current microfrontend or any of its child microfrontends has gained or lost focus.
     * The Observable does not emit while the focus remains within this microfrontend or any of its child microfrontends.
     * Upon subscription, the Observable emits the current focus-within state, and then continuously emits when it changes.
     * It never completes.
     *
     * This Observable is like the `:focus-within` CSS pseudo-class but operates across iframe boundaries.
     * For example, it can be useful when implementing overlays that close upon focus loss.
     *
     * Note that this Observable emits only for microfrontends that are connected to the platform as registered micro app.
     *
     * See also the `onfocuswithin` event triggered by `<sci-router-outlet>` when embedded content has gained or lost focus.
     */
    readonly focusWithin$: Observable<boolean>;
    /**
     * Observable that emits when the current microfrontend has gained or lost focus.
     *
     * Upon subscription, the Observable emits the current focus state, and then continuously emits when it changes.
     * It never completes.
     */
    readonly focus$: Observable<boolean>;
}

/**
 * Allows web content displayed in a {@link SciRouterOutletElement `<sci-router-outlet>`} to define its preferred size.
 *
 * The preferred size of an element is the minimum size that will allow it to display normally.
 * Setting a preferred size is useful if the outlet is displayed in a layout that aligns its items based on the items's content size.
 *
 * When setting a preferred size, the outlet containing this microfrontend will adapt its size to the reported preferred size.
 *
 * @category Preferred Size
 */
declare class PreferredSizeService implements PreDestroy {
    private _destroy$;
    private _fromDimensionElementChange$;
    private _preferredSizePublisher;
    /**
     * Sets the preferred size of this web content.
     * The size is reported to the router outlet embedding this web content and is used as the outlet's size.
     */
    setPreferredSize(preferredSize: PreferredSize): void;
    /**
     * Determines the preferred size from the given element's dimension and reports it to the router outlet embedding this web content.
     * As the value for the preferred size, the `offset-width` and `offset-height` of the element are used, which is the total amount of space
     * the element occupies, including the width of the visible content, scrollbars (if any), padding, and border.
     *
     * When the size of the element changes, the changed size is reported to the outlet, which then adaps its size accordingly.
     * To stop the notifying of the preferred size to the outlet, pass `undefined` as the value, which also unsets the preferred size.
     *
     * If the element is removed from the DOM, the preferred size is reset and reporting suspended until it is attached again.
     * If a new element is set as dimension observer, then the previous one is unsubscribed.
     *
     * *Prerequisites*
     * - The element to be observed must behave as block-level box and not as inline-level box. So, if you want to observe an inline element,
     *   set its display type to either `block` or `inline-block`.
     * - If the element to be observed should not fill the remaining space and may change in size, we recommend taking it out of the document
     *   element flow, i.e., position it absolutely without defining a width and height. Otherwise, once the element has reported a preferred
     *   size, it could not shrink below that size.
     *
     * @param element - The element of which the preferred size is to be observed and used as the outlet's size.
     */
    fromDimension(element: HTMLElement | undefined): void;
    /**
     * Resets the preferred size. Has no effect if no preferred size is set.
     */
    resetPreferredSize(): void;
    /** @ignore */
    preDestroy(): void;
}

/**
 * Allows browsing the catalog of capabilities and managing the capabilities of the application.
 *
 * The app can browse only capabilities which are visible to it, i.e., for which the app has declared an intention and
 * which are also publicly available. Capabilities that the app provides itself are always visible to the app.
 *
 * The app can also provide new capabilities or remove existing ones. If the *Intention Registration API* is enabled
 * for the app, the app can also manage its intentions, which, however, is discouraged. Instead, apps should
 * declare the required functionality in their manifests using wildcard intentions.
 *
 * @category Intention API
 */
declare class ManifestService implements Initializer {
    private _applications;
    init(): Promise<void>;
    /**
     * Applications installed in the platform.
     */
    get applications(): ReadonlyArray<Application>;
    /**
     * Returns the specified application. If not found, by default, throws an error unless setting the `orElseNull` option.
     */
    getApplication(symbolicName: string): Application;
    getApplication(symbolicName: string, options: {
        orElse: null;
    }): Application | null;
    /**
     * Allows browsing the catalog of capabilities that match the given filter.
     *
     * <strong>
     * You can only browse capabilities that are visible to your application, that is, capabilities that you provide yourself or that are
     * publicly available and for which you have declared an intention in your manifest.
     * </strong>
     *
     * @param  filter - Control which capabilities to browse. If no or an empty filter is given, all capabilities visible to the requesting
     *         app are returned. Specified filter criteria are "AND"ed together.\
     *         <p>
     *         If specifying a qualifier filter, the capabilities must match that filter exactly. The filter supports the asterisk wildcard
     *         to match any value, e.g., `{property: '*'}`, or partial matching to find capabilities with at least the specified qualifier
     *         properties. Partial matching is enabled by appending the _any-more_ entry to the qualifier, as following: `{'*': '*'}`.
     * @return An Observable that, when subscribed, emits the requested capabilities.
     *         It never completes and emits continuously when fulfilling capabilities are registered or unregistered.
     */
    lookupCapabilities$<T extends Capability>(filter?: ManifestObjectFilter): Observable<T[]>;
    /**
     * Allows browsing the catalog of intentions that match the given filter.
     *
     * @param  filter - Control which intentions to return. If no or an empty filter is given, no filtering takes place. Specified filter
     *         criteria are "AND"ed together.\
     *         <p>
     *         If specifying a qualifier filter, the intentions must match that filter exactly. The filter supports the asterisk wildcard
     *         to match any value, e.g., `{property: '*'}`, or partial matching to find intentions with at least the specified qualifier
     *         properties. Partial matching is enabled by appending the _any-more_ entry to the qualifier, as following: `{'*': '*'}`.
     * @return An Observable that, when subscribed, emits the requested intentions.
     *         It never completes and emits continuously when matching intentions are registered or unregistered.
     */
    lookupIntentions$(filter?: ManifestObjectFilter): Observable<Intention[]>;
    /**
     * Registers given capability. If the capability has public visibility, other applications can browse the capability and interact with it.
     *
     * @return A Promise that resolves to the identity of the registered capability, if registered, or `null` if rejected by a {@link CapabilityInterceptor}.
     *         The promise rejects if the registration failed.
     */
    registerCapability<T extends Capability>(capability: T): Promise<string | null>;
    /**
     * Unregisters capabilities matching the given filter.
     *
     * <strong>You can only unregister capabilities of your application.</strong>
     *
     * @param  filter - Control which capabilities to unregister by specifying filter criteria which are "AND"ed together. If not passing a filter,
     *         all capabilities of the requesting app are unregistered.\
     *         <p>
     *         If specifying a qualifier filter, the capabilities to unregister must match that filter exactly. The filter supports the asterisk
     *         wildcard to match any value, e.g., `{property: '*'}`, or partial matching to unregister capabilities with at least the specified
     *         qualifier properties. Partial matching is enabled by appending the _any-more_ entry to the qualifier, as following: `{'*': '*'}`.
     *         Note that specifying a symbolic app name in the filter has no effect.
     * @return A Promise that resolves when unregistered the capability,
     *         or that rejects if the unregistration failed.
     */
    unregisterCapabilities(filter?: ManifestObjectFilter): Promise<void>;
    /**
     * Registers the given intention, allowing the application to interact with public capabilities matching the intention.
     *
     * The intention can match multiple capabilities by using the asterisk wildcard in the qualifier.
     *
     * <strong>This operation requires that the 'Intention Registration API' is enabled for your application.</strong>
     *
     * @return A Promise that resolves to the identity of the registered intention,
     *         or that rejects if the registration failed.
     */
    registerIntention(intention: Intention): Promise<string>;
    /**
     * Unregisters intentions matching the given filter.
     *
     * <strong>You can only unregister intentions of your application.</strong>
     * <strong>This operation requires that the 'Intention Registration API' is enabled for your application.</strong>
     *
     * @param  filter - Control which intentions to unregister by specifying filter criteria which are "AND"ed together. If not passing a filter,
     *         all intentions of the requesting app are unregistered.\
     *         <p>
     *         If specifying a qualifier filter, the intentions to unregister must match that filter exactly. The filter supports the asterisk
     *         wildcard to match any value, e.g., `{property: '*'}`, or partial matching to unregister intentions with at least the specified
     *         qualifier properties. Partial matching is enabled by appending the _any-more_ entry to the qualifier, as following: `{'*': '*'}`.
     *         Note that specifying a symbolic app name in the filter has no effect.
     * @return A Promise that resolves when unregistered the intention,
     *         or that rejects if the unregistration failed.
     */
    unregisterIntentions(filter?: ManifestObjectFilter): Promise<void>;
    /**
     * Tests whether the specified application is qualified to access the given capability.
     *
     * An application is qualified if following criteria are met:
     * - The capability is active (1).
     * - The capability is provided by the application, or provided by another application with
     *   public visibility (2), and the application has an intention (3) for the capability.
     *
     * (1) Unless 'Capability Active Check' is disabled for the application.
     * (2) Unless 'Scope Check' is disabled for the application.
     * (3) Unless 'Intention Check' is disabled for the application.
     *
     * @param appSymbolicName - Symbolic name of the application under test.
     * @param qualifiedFor
     * @param qualifiedFor.capabilityId - Identifies the capability to test.
     * @return An Observable that, when subscribed, emits the qualification of specified application.
     *         It never completes and emits continuously when capabilites or intentions are registered or unregistered.
     */
    isApplicationQualified$(appSymbolicName: string, qualifiedFor: {
        capabilityId: string;
    }): Observable<boolean>;
}

/**
 * Control how to publish a message.
 *
 * @category Messaging
 */
interface PublishOptions {
    /**
     * Sets headers to pass additional information with a message.
     */
    headers?: Map<string, unknown>;
    /**
     * Instructs the broker to store this message on the broker as a retained message.
     *
     * Unlike a regular message, a retained message remains in the broker and is delivered to new subscribers, even if
     * they subscribe after the message has been sent.
     *
     * For retained messages, the broker stores one retained message per destination (topic or capability), i.e.,
     * a later sent retained message will replace a previously sent retained message. To delete a retained message,
     * send a retained message without payload to the same destination.
     *
     * For retained requests, the broker stores all retained requests until the requestor unsubscribes.
     */
    retain?: boolean;
}
/**
 * Control how to publish a request in request-response communication.
 *
 * @category Messaging
 */
type RequestOptions = PublishOptions;

/**
 * Message client for sending and receiving messages between microfrontends across origins.
 *
 * This client implements the topic-based pub/sub (publish/subscribe) messaging model, allowing for one message to be delivered to
 * multiple subscribers using topic addressing.
 *
 * The communication is built on top of the native `postMessage` mechanism. The host app acts as message broker.
 *
 * ### Topic Addressing
 * A publisher publishes a message to a topic, which then is transported to consumers subscribed to the topic. Topics are case-sensitive
 * and consist of one or more segments, each separated by a forward slash. When publishing a message to a topic, the topic must be exact,
 * thus not contain wildcards. Messages published to a topic are transported to all consumers subscribed to the topic. Consumers, on the
 * other hand, can subscribe to multiple topics simultaneously by using wildcard segments in the topic.
 *
 * ### Retained Message
 * You can mark a message as "retained" for helping newly subscribed clients to get the last message published to a topic immediately upon
 * subscription. The broker stores one retained message per topic, i.e., a later sent retained message will replace a previously sent retained
 * message. To delete a retained message, send a retained message without payload to the topic.
 *
 * ### Retained Request
 * Unlike retained messages, retained requests are not replaced by later retained requests/messages and remain in the broker until the requestor unsubscribes.
 *
 * ### Request-Response Messaging
 * Sometimes it is useful to initiate a request-response communication to wait for a response. Unlike with fire-and-forget messaging, a temporary
 * inbox is created for the sender to receive replies. If there is no consumer subscribed on the topic, the platform throws an error.
 *
 * @see {@link TopicMessage}
 * @see {@link takeUntilUnsubscribe}
 *
 * @category Messaging
 */
declare abstract class MessageClient {
    /**
     * Publishes a message to the given topic. The message is transported to all consumers subscribed to the topic.
     *
     * A message can be marked as "retained" by setting the {@link PublishOptions.retain} flag to `true`. It instructs the broker to store this message and
     * deliver it to new subscribers, even if they subscribe after the message has been published. The broker stores one retained message per topic. To
     * delete a retained message, send a retained message without payload to the topic. Deletion messages are not transported to subscribers.
     *
     * @param  topic - Specifies the topic to which the message should be sent.
     *         Topics are case-sensitive and consist of one or more segments, each separated by a forward slash.
     *         The topic is required and must be exact, thus not contain wildcards.
     * @param  message - Specifies optional transfer data to be carried along with this message.
     *         It can be any object which is serializable with the structured clone algorithm.
     * @param  options - Controls how to publish the message and allows setting message headers.
     * @return A Promise that resolves when dispatched the message, or that rejects if the message could not be dispatched.
     */
    abstract publish<T = unknown>(topic: string, message?: T, options?: PublishOptions): Promise<void>;
    /**
     * Sends a request to the given topic and receives one or more replies.
     *
     * A request can be marked as "retained" by setting the {@link RequestOptions.retain} flag to `true`. It instructs the broker to store this request and
     * deliver it to new subscribers, even if they subscribe after the request has been sent. Retained requests are not replaced by later retained requests/
     * messages and remain in the broker until the requestor unsubscribes.
     *
     * If not marking the request as "retained", at least one subscriber must be subscribed to the topic. Otherwise, the request is rejected.
     *
     * @param  topic - Specifies the topic to which the request should be sent.
     *         Topics are case-sensitive and consist of one or more segments, each separated by a forward slash.
     *         The topic is required and must be exact, thus not contain wildcards.
     * @param  request - Specifies optional transfer data to be carried along with the request.
     *         It can be any object which is serializable with the structured clone algorithm.
     * @param  options - Controls how to send the request and allows setting request headers.
     * @return An Observable that emits when receiving a reply. It never completes unless the replier sets the status code {@link ResponseStatusCodes.TERMINAL}
     *         in the {@link MessageHeaders.Status} message header. Then, the Observable completes immediately after emitted the reply.
     *         The Observable errors if the request could not be dispatched. It will also error if the replier sets a status code greater than or equal to 400, e.g., {@link ResponseStatusCodes.ERROR}.
     */
    abstract request$<T>(topic: string, request?: unknown, options?: RequestOptions): Observable<TopicMessage<T>>;
    /**
     * Receives messages published to the given topic.
     *
     * You can subscribe to multiple topics simultaneously by using wildcard segments in the topic. If a segment begins with a colon (`:`),
     * then the segment acts as a placeholder for any segment value. Substituted segment values are then available via the params property
     * of the received message.
     *
     * ```ts
     * const topic: string = 'myhome/:room/temperature';
     *
     * Beans.get(MessageClient).observe$(topic).subscribe((message: TopicMessage) => {
     *   console.log(message.params);
     * });
     * ```
     *
     * If the received message has the {@link MessageHeaders.ReplyTo} header field set, the publisher expects the receiver to send one or more
     * replies to that {@link MessageHeaders.ReplyTo ReplyTo} topic. If streaming responses, you can use the {@link takeUntilUnsubscribe}
     * operator to stop replying when the requestor unsubscribes.
     *
     * ```ts
     * const topic: string = 'myhome/livingroom/temperature';
     *
     * Beans.get(MessageClient).observe$(topic).subscribe((request: TopicMessage) => {
     *   const replyTo = request.headers.get(MessageHeaders.ReplyTo);
     *   sensor$
     *     .pipe(takeUntilUnsubscribe(replyTo))
     *     .subscribe(temperature => {
     *       Beans.get(MessageClient).publish(replyTo, `${temperature}°C`);
     *     });
     * });
     * ```
     *
     * @param  topic - Specifies the topic which to observe.
     *         Topics are case-sensitive and consist of one or more segments, each separated by a forward slash.
     *         You can subscribe to the exact topic of a published message, or use wildcards to subscribe to multiple
     *         topics simultaneously. If a segment begins with a colon (`:`), then the segment acts as a placeholder for any
     *         string value. Substituted segment values are available in the {@link TopicMessage.params} on the received message.
     * @return An Observable that emits messages sent to the given topic. It never completes.
     */
    abstract observe$<T>(topic: string): Observable<TopicMessage<T>>;
    /**
     * Convenience API for handling messages.
     *
     * Unlike `observe$`, messages are passed to a callback function rather than emitted from an Observable. Response(s) can be returned directly
     * from the callback. It supports error propagation and request termination. Using this method over `observe$` significantly reduces the code
     * required to respond to requests.
     *
     * For each message received, the specified callback function is called. When used in request-response communication,
     * the callback function can return the response either directly or in the form of a Promise or Observable. Returning a Promise
     * allows the response to be computed asynchronously, and an Observable allows to return one or more responses, e.g., for
     * streaming data.
     * If the callback function returns no value (void), returns `undefined`, or returns a Promise that resolves to `undefined`, communication is terminated
     * immediately without a response. If the callback returns an Observable, all its emissions are transported to the requestor and communication is not
     * terminated until the Observable completes. Termination of communication always completes the requestor's Observable.
     * If the callback throws an error, or the returned Promise or Observable errors, the error is
     * transported to the requestor, erroring the requestor's Observable.
     *
     * @param  topic - Specifies the topic which to observe.
     *         For more information, see the API description of {@link observe$}.
     * @param  callback - Specifies the callback to be called for each message. When used in request-response communication,
     *         the callback function can return the response either directly or in the form of a Promise or Observable. If returning
     *         a response in fire-and-forget communication, it is ignored. Throwing an error in the callback does not unregister the callback.
     * @return Subscription to unregister the callback. Calling {@link rxjs!Subscription.unsubscribe Subscription.unsubscribe} will complete the Observable of all
     *         requestors, if any.
     */
    abstract onMessage<IN = unknown, OUT = unknown>(topic: string, callback: (message: TopicMessage<IN>) => Observable<OUT> | Promise<OUT> | OUT | void): Subscription;
    /**
     * Allows observing the number of subscriptions on a topic. The Observable never completes.
     *
     * @param  topic - Specifies the topic to observe. The topic must be exact, thus not contain wildcards.
     * @return An Observable that, when subscribed, emits the current number of subscribers on it. It never completes and
     *         emits continuously when the number of subscribers changes.
     */
    abstract subscriberCount$(topic: string): Observable<number>;
}
/**
 * Returns an Observable that mirrors the source Observable as long as there is at least one subscriber subscribed to the
 * given topic. When the subscription count on the given topic drops to zero, the returned Observable completes. If there
 * is no topic subscription present at the time when subscribing to the Observable, then it completes immediately.
 *
 * This operator is similar to the RxJS {@link rxjs!takeUntil takeUntil} operator, but accepts a topic instead of a notifier Observable.
 *
 * @category Messaging
 */
declare function takeUntilUnsubscribe<T>(topic: string): MonoTypeOperatorFunction<T>;

/**
 * Allows sending and receiving intents between microfrontends across origins.
 * This client is part of the Intention API of the SCION Microfrontend Platform.
 *
 * Intent-based messaging enables controlled collaboration between micro applications, a mechanism known from Android development
 * where an application can start an activity via an intent (such as sending an email).
 *
 * Like topic-based communication, intent-based communication implements the pub/sub (publish/subscribe) messaging pattern, but is,
 * in contrast, more restrictive when sending messages. Sending messages is also referred to as issuing intents. It requires the sending
 * application to declare an intention in its manifest. Intents are received only by applications that provide a fulfilling capability.
 * If no application provides a fulfilling capability, the platform rejects the intent.
 *
 * The communication is built on top of the native `postMessage` mechanism. The host app acts as message broker.
 *
 * #### Intent Addressing
 * In intent-based communication, the destination are capabilities, formulated in an abstract way, consisting of a a type, and optionally
 * a qualifier. The type categorizes a capability in terms of its functional semantics. A capability may also define a qualifier to
 * differentiate the different capabilities of the same type. The type is a string literal and the qualifier a dictionary of key-value pairs.
 *
 * ### Retained Intents
 * You can mark an intent as "retained" for helping newly subscribed clients to get the last intent published for a capability immediately upon
 * subscription. The broker stores one retained intent per capability, i.e., a later sent retained intent will replace a previously sent retained
 * intent. To delete a retained intent, send a retained intent without payload to the same destination.
 *
 * ### Retained Request
 * Unlike retained intents, retained requests are not replaced by later retained requests/intents and remain in the broker until the requestor unsubscribes.
 *
 * ### Request-Response Messaging
 * Sometimes it is useful to initiate a request-response communication to wait for a response. Unlike with fire-and-forget intents, a temporary
 * inbox is created for the intent issuer to receive replies.
 *
 * @see {@link IntentMessage}
 * @see {@link Intent}
 * @see {@link MessageHeaders}
 *
 * @category Messaging
 * @category Intention API
 */
declare abstract class IntentClient {
    /**
     * Sends an intent.
     *
     * A micro application can send intents for intentions declared in its manifest. The platform transports the intent to micro applications
     * that provide a fulfilling capability. Along with the intent, the application can pass transfer data, either as payload, message headers
     * or parameters. Passed data must be serializable with the Structured Clone Algorithm.
     *
     * A micro application is implicitly qualified to interact with capabilities that it provides; thus, it must not declare an intention.
     *
     * An intent can be marked as "retained" by setting the {@link PublishOptions.retain} flag to `true`. It instructs the broker to store this intent and
     * deliver it to new subscribers, even if they subscribe after the intent has been published. The broker stores one retained intent per capability. To
     * delete a retained intent, send a retained intent without payload. Deletion intents are not transported to subscribers.
     *
     * @param  intent - Describes the intent. The qualifier, if any, must be exact, thus not contain wildcards.
     * @param  body - Specifies optional transfer data to be carried along with the intent.
     *         It can be any object which is serializable with the structured clone algorithm.
     * @param  options - Controls how to issue the intent and allows setting message headers.
     * @return A Promise that resolves when dispatched the intent, or that rejects if the intent could not be dispatched,
     *         e.g., if missing the intention declaration, or because no application is registered to handle the intent.
     */
    abstract publish<T = unknown>(intent: Intent, body?: T, options?: PublishOptions): Promise<void>;
    /**
     * Sends an intent and receives one or more replies.
     *
     * A micro application can send intents for intentions declared in its manifest. The platform transports the intent to micro applications
     * that provide a fulfilling capability. Along with the intent, the application can pass transfer data, either as payload, message headers
     * or parameters. Passed data must be serializable with the Structured Clone Algorithm.
     *
     * A micro application is implicitly qualified to interact with capabilities that it provides; thus, it must not declare an intention.
     *
     * A request can be marked as "retained" by setting the {@link RequestOptions.retain} flag to `true`. It instructs the broker to store this request and
     * deliver it to new subscribers, even if they subscribe after the request has been sent. Retained requests are not replaced by later retained requests/
     * intents and remain in the broker until the requestor unsubscribes.
     *
     * If not marking the request as "retained", at least one subscriber must be subscribed to the intent. Otherwise, the request is rejected.
     *
     * @param  intent - Describes the intent. The qualifier, if any, must be exact, thus not contain wildcards.
     * @param  body - Specifies optional transfer data to be carried along with the intent.
     *         It can be any object which is serializable with the structured clone algorithm.
     * @param  options - Controls how to send the request and allows setting request headers.
     * @return An Observable that emits when receiving a reply. It never completes unless the replier sets the status code {@link ResponseStatusCodes.TERMINAL}
     *         in the {@link MessageHeaders.Status} message header. Then, the Observable completes immediately after emitted the reply.
     *         The Observable errors if the request could not be dispatched. It will also error if the replier sets a status code greater than or equal to 400, e.g., {@link ResponseStatusCodes.ERROR}.
     */
    abstract request$<T>(intent: Intent, body?: unknown, options?: RequestOptions): Observable<TopicMessage<T>>;
    /**
     * Receives an intent when some micro application wants to collaborate with this micro application.
     *
     * Intents are typically subscribed to in an activator. Refer to {@link ActivatorCapability} for more information.
     *
     * The micro application receives only intents for which it provides a fulfilling capability.
     * You can filter received intents by passing a selector. The selector supports the use of wildcards.
     *
     * If the received intent has the {@link MessageHeaders.ReplyTo} header field set, the publisher expects the receiver to send one or more
     * replies to that {@link MessageHeaders.ReplyTo ReplyTo} topic. If streaming responses, you can use the {@link takeUntilUnsubscribe}
     * operator to stop replying when the requestor unsubscribes.
     *
     * ```typescript
     *  const selector: IntentSelector = {
     *    type: 'temperature',
     *    qualifier: {room: 'kitchen'},
     *  };
     *
     *  Beans.get(IntentClient).observe$(selector).subscribe((request: IntentMessage) => {
     *    const replyTo = request.headers.get(MessageHeaders.ReplyTo);
     *    sensor$
     *      .pipe(takeUntilUnsubscribe(replyTo))
     *      .subscribe(temperature => {
     *        Beans.get(MessageClient).publish(replyTo, `${temperature}°C`);
     *      });
     *  });
     * ```
     *
     * @param  selector - Allows filtering intents. Note that the passed filter is only a filter for intents the application is qualified for, i.e., provides a fulfilling capability visible to the sender.
     *         In the qualifier of the filter, you can use the asterisk wildcard character (`*`) to match multiple intents simultaneously.
     *         - Asterisk wildcard character (*)
     *           Matches intents with such a qualifier property no matter of its value (except `null` or `undefined`). Use it like this: `{property: '*'}`.
     *         - Partial wildcard (**)
     *           Matches intents even if having additional properties. Use it like this: `{'*': '*'}`.
     *
     * @return An Observable that emits received intents. It never completes.
     */
    abstract observe$<T>(selector?: IntentSelector): Observable<IntentMessage<T>>;
    /**
     * Convenience API for handling intents.
     *
     * Unlike `observe$`, intents are passed to a callback function rather than emitted from an Observable. Response(s) can be returned directly
     * from the callback. It supports error propagation and request termination. Using this method over `observe$` significantly reduces the code
     * required to respond to requests.
     *
     * For each intent received, the specified callback function is called. When used in request-response communication,
     * the callback function can return the response either directly or in the form of a Promise or Observable. Returning a Promise
     * allows the response to be computed asynchronously, and an Observable allows to return one or more responses, e.g., for
     * streaming data.
     * If the callback function returns no value (void), returns `undefined`, or returns a Promise that resolves to `undefined`, communication is terminated
     * immediately without a response. If the callback returns an Observable, all its emissions are transported to the requestor and communication is not
     * terminated until the Observable completes. Termination of communication always completes the requestor's Observable.
     * If the callback throws an error, or the returned Promise or Observable errors, the error is
     * transported to the requestor, erroring the requestor's Observable.
     *
     * @param  selector - Allows filtering intents.
     *         For more information, see the API description of {@link observe$}.
     * @param  callback - Specifies the callback to be called for each intent. When used in request-response communication,
     *         the callback function can return the response either directly or in the form of a Promise or Observable. If returning
     *         a response in fire-and-forget communication, it is ignored. Throwing an error in the callback does not unregister the callback.
     * @return Subscription to unregister the callback. Calling {@link rxjs!Subscription.unsubscribe Subscription.unsubscribe} will complete the Observable of all
     *         requestors, if any.
     */
    abstract onIntent<IN = unknown, OUT = unknown>(selector: IntentSelector, callback: (intentMessage: IntentMessage<IN>) => Observable<OUT> | Promise<OUT> | OUT | void): Subscription;
}
/**
 * Allows filtering intents.
 *
 * @category Messaging
 * @category Intention API
 */
interface IntentSelector {
    /**
     * If specified, filters intents of the given type.
     */
    type?: string;
    /**
     * If specified, filters intents matching the given qualifier. You can use the asterisk wildcard (`*`) to match multiple intents.
     * - Asterisk wildcard character (*)
     *   Matches intents with such a qualifier property no matter of its value (except `null` or `undefined`). Use it like this: `{property: '*'}`.
     * - Partial wildcard (**)
     *   Matches intents even if having additional properties. Use it like this: `{'*': '*'}`.
     */
    qualifier?: Qualifier;
}

/**
 * Allows looking up properties defined in the platform host.
 *
 * @category Platform
 */
declare class PlatformPropertyService implements Initializer {
    private _properties;
    init(): Promise<void>;
    /**
     * Indicates whether a property with the specified key exists or not.
     */
    contains(key: string): boolean;
    /**
     * Returns the property of the given key, or `defaultValue` if the property does not exist.
     *
     * Throws an error if `defaultValue` is not specified and the property does not exist.
     */
    get<T>(key: string, defaultValue?: T): T;
    /**
     * Returns the properties map.
     */
    properties(): Map<string, unknown>;
}

/**
 * Stops the platform and disconnects this client from the host when the browser unloads the document.
 *
 * By default, the platform initiates shutdown when the browser unloads the document, i.e., when `beforeunload` is triggered.
 * The main reason for `beforeunload` instead of `unload` is to avoid posting messages to disposed windows.
 * However, if `beforeunload` is not triggered, e.g., when an iframe is removed, we fall back to `unload`.
 *
 * @category Platform
 */
declare abstract class MicrofrontendPlatformStopper {
}

/**
 * Logger used by the platform to log to the console.
 *
 * Replace this bean to capture the log output.
 *
 * @category Platform
 */
declare abstract class Logger {
    /**
     * Logs with severity debug.
     */
    abstract debug(message?: unknown, ...args: unknown[]): void;
    /**
     * Logs with severity info.
     */
    abstract info(message?: unknown, ...args: unknown[]): void;
    /**
     * Logs with severity warn.
     */
    abstract warn(message?: unknown, ...args: unknown[]): void;
    /**
     * Logs with severity error.
     */
    abstract error(message?: unknown, ...args: unknown[]): void;
}

/**
 * Allows testing whether an exact topic matches a pattern topic. The pattern topic may contain wildcard segments.
 *
 * Topics are case-sensitive and consist of one or more segments, each separated by a forward slash.
 *
 * @category Messaging
 */
declare class TopicMatcher {
    private readonly _patternSegments;
    /**
     * Constructs a matcher that will match given topics against this pattern.
     *
     * @param pattern - Pattern to match topics. The pattern is a topic, not a regular expression; thus, it must consist of one or more segments,
     *                  each separated by a forward slash. The pattern supports wildcard segments beginning with a colon (`:`). Wildcard segments
     *                  act as a placeholder for any segment value.
     */
    constructor(pattern: string);
    /**
     * Attempts to match the given topic against the pattern which was passed to the constructor.
     *
     * If the match succeeds, then {@link MatcherResult.matches} evaluates to `true`. If the pattern contains wildcard segments,
     * the matched segments can be read using the property {@link TopicMessage.params} property.
     *
     * @param topic - The topic to match against the configured pattern; must be an exact topic, thus not contain wildcard segments.
     * @return The result of the topic matcher test.
     */
    match(topic: string): MatcherResult;
}
/**
 * Represents the result of a topic matcher test.
 *
 * @category Messaging
 */
interface MatcherResult {
    /**
     * Indicates if the topic matches the pattern topic.
     */
    matches: boolean;
    /**
     * Contains the actual values for the wildcard segments as defined in the pattern topic; is only set if the match is successful.
     */
    params?: Map<string, string>;
}

/**
 * Allows testing whether a qualifier matches a qualifier pattern.
 *
 * @category Intention API
 */
declare class QualifierMatcher {
    private readonly _pattern;
    private readonly _patternKeys;
    /**
     * Constructs a matcher that will match given qualifiers against a pattern.
     *
     * @param pattern - Pattern to match qualifiers. If `null` or `undefined`, uses an empty qualifier pattern.
     */
    constructor(pattern: Qualifier | null | undefined);
    /**
     * Attempts to match the given qualifier against the pattern which was passed to the constructor.
     */
    matches(qualifier: Qualifier | null | undefined): boolean;
}

/**
 * Allows testing whether params match the param definitions.
 *
 * @category Intention API
 */
declare class ParamMatcher {
    private readonly _requiredParamDefs;
    private readonly _optionalParamDefs;
    private readonly _deprecatedParamDefs;
    constructor(definitions: ParamDefinition[] | undefined | null);
    /**
     * Tests if the given params match the param definitions.
     */
    match(params: Map<string, unknown> | {
        [name: string]: unknown;
    } | null | undefined): ParamMatcherResult;
}
/**
 * Represents the result of a params matcher test.
 */
interface ParamMatcherResult {
    /**
     * Indicates whether the params match the param definitions.
     */
    matches: boolean;
    /**
     * Params as passed to the matcher, but with deprecated params mapped to their substitute,
     * or `undefined` if the match is not successful.
     */
    params: Map<string, unknown> | undefined;
    /**
     * Required params that are missing.
     */
    missingParams: ParamDefinition[];
    /**
     * Params that are not expected.
     */
    unexpectedParams: string[];
    /**
     * Params that are deprecated.
     */
    deprecatedParams: ParamDefinition[];
}

/**
 * Enables the decoration of RxJS Observables provided by the SCION Microfrontend Platform to control their emission context.
 *
 * The emission context of an Observables may be different than the subscription context, which can lead to unexpected behavior
 * on the subscriber side. For example, Angular uses zones (Zone.js) to trigger change detection. Angular applications expect
 * an RxJS Observable to emit in the same Angular zone in which subscribed to the Observable. That is, if subscribing inside
 * the Angular zone, emissions are expected to be received inside the Angular zone. Otherwise, the UI may not be updated as
 * expected but delayed until the next change detection cycle. Similarly, if subscribing outside the Angular zone, emissions
 * are expected to be received outside the Angular zone. Otherwise, this would cause unnecessary change detection cycles
 * resulting in potential performance degradation.
 *
 * ### Example for Angular Applications
 *
 * For Angular applications, we recommend installing the following decorator:
 *
 * ```ts
 * import {NgZone} from '@angular/core';
 * import {ObservableDecorator} from '@scion/microfrontend-platform';
 * import {Observable} from 'rxjs';
 * import {observeIn, subscribeIn} from '@scion/toolkit/operators';
 *
 * export class NgZoneObservableDecorator implements ObservableDecorator {
 *
 *   constructor(private zone: NgZone) {
 *   }
 *
 *   public decorate$<T>(source$: Observable<T>): Observable<T> {
 *      return new Observable<T>(observer => {
 *        const insideAngular = NgZone.isInAngularZone();
 *        const subscription = source$
 *          .pipe(
 *            subscribeIn(fn => this.zone.runOutsideAngular(fn)),
 *            observeIn(fn => insideAngular ? this.zone.run(fn) : this.zone.runOutsideAngular(fn)),
 *          )
 *          .subscribe(observer);
 *        return () => subscription.unsubscribe();
 *      });
 *    }
 * }
 * ```
 *
 * A decorator can be registered with the bean manager under the symbol `ObservableDecorator`, as following:
 *
 * ```ts
 * Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
 * ```
 *
 * @category Messaging
 */
declare abstract class ObservableDecorator {
    /**
     * Decorates given Observable.
     *
     * @param  source$ - Observable to be decorated.
     * @return Decorated Observable.
     */
    abstract decorate$<T>(source$: Observable<T>): Observable<T>;
}

export { ACTIVATION_CONTEXT, APP_IDENTITY, CapabilityInterceptor, ContextService, FocusMonitor, Handler, HostManifestInterceptor, IS_PLATFORM_HOST, IntentClient, IntentInterceptor, Logger, ManifestService, MessageClient, MessageHeaders, MessageInterceptor, MicrofrontendPlatform, MicrofrontendPlatformClient, MicrofrontendPlatformConfig, MicrofrontendPlatformHost, MicrofrontendPlatformStopper, OUTLET_CONTEXT, ObservableDecorator, OutletRouter, PRIMARY_OUTLET, ParamMatcher, PlatformCapabilityTypes, PlatformPropertyService, PlatformState, PreferredSizeService, QualifierMatcher, RelativePathResolver, RequestError, RequestMethods, ResponseStatusCodes, RouterOutletUrlAssigner, SciRouterOutletElement, TopicMatcher, mapToBody, takeUntilUnsubscribe, throwOnErrorStatus };
export type { ActivationContext, ActivatorCapability, Application, ApplicationConfig, ApplicationQualifiedForCapabilityRequest, Capability, ConnectOptions, ContextLookupOptions, HostConfig, Intent, IntentMessage, IntentSelector, Intention, Interceptor, LivenessConfig, Manifest, ManifestObjectFilter, MatcherResult, Message, MicrofrontendCapability, Navigation, NavigationOptions, OutletContext, ParamDefinition, ParamMatcherResult, PreferredSize, PublishOptions, Qualifier, RequestOptions, TopicMessage };
