import { LitElement } from "lit";
import type { PropertyValues, TemplateResult } from "lit";
import { StateDeclaration, ViewContext, StateObject } from "@uirouter/core";
import { UIRouterLit } from "./core.js";
/** @internal */
export interface UiViewAddress {
context: ViewContext | StateObject;
fqn: string;
}
/**
* @hideconstructor
* @category components
*
* @slot - <ui-view> renders slotted content as fallback
* whenever no routed component is active.
*
* @fires {CustomEvent} ui-router-context
*
* This event is fired to obtain the uiRouter instance,
* when not directly provided.
* Once obtained, the <ui-view> listens and
* provides the uiRouter to descendants.
*
* @fires {CustomEvent} ui-view-context
*
* This event is fired to obtain the parent <ui-view>.
*
* @summary
*
* This is the <ui-view> component.
*
* The <ui-view> component is a viewport for routed components.
* Routed components will be rendered inside the <ui-view> viewport.
*
*/
export declare class UiView extends LitElement {
/** the view name this viewport fills; empty selects the `$default` view */
name: string;
/**
* <ui-view> can be used without <ui-router>
* by providing the uiRouter property directly.
*/
uiRouter: UIRouterLit;
private viewAddress;
/** Replaced only by a real view config change, so a retained view keeps its subtree. */
private component;
/** Created on connect: the @lit-labs/ssr DOM shim has no `createDocumentFragment`. */
private inner?;
/** @internal */
createRenderRoot(): this;
private readonly viewId;
private _uiViewData;
private resolveContext;
private _viewConfigUpdated;
private _applyUpdatedConfig;
private parentView;
private readonly onUiViewContextEvent;
/** @internal */
connectedCallback(): void;
private static readonly uiViewContextEventName;
private static uiViewContextEvent;
/** @internal */
static seekParentView(candidate: Element): UiView | null;
private seekParentView;
private readonly onUiRouterContextEvent;
private seekRouter;
/** Whether `uiRouter` came from the context event rather than the app. */
private routerFromProvider;
/** The router this view registered with; a late upgrade can supersede it. */
private registeredRouter?;
/** Set only for the synchronous span of our own re-seek. */
private seekingProvidedRouter;
/**
* Seeks the provider's router, past our own answer.
*
* `` answers this event for descendants and stops it, deliberately —
* see `listener-identity.spec.ts`. Suppressing that for the span of our own
* dispatch keeps the guarantee intact for everyone else.
*/
private seekProvidedRouter;
/**
* Adopts the router the provider now offers, when this view registered
* without it.
*
* lit replays a pre-upgrade property inside the element's first update, not
* at upgrade, so `` can run `connectedCallback` with `uiRouter`
* still undefined and provide an instance of its own; a ``
* connecting in between registers with that one and never sees a transition.
* Firefox upgrades a detached subtree later than Chrome and WebKit, so
* declarative shadow DOM parsed off-document reaches this there first.
*
* `registerUIView` syncs, so the re-registered view picks up the current
* state without waiting for the next transition.
*/
private adoptProvidedRouter;
private deregisterAll;
private captureContent;
private readonly disconnectedHandlers;
private setupUiView;
/** @internal */
disconnectedCallback(): void;
/**
* For each transition, checks the component loaded in the ui-view for:
*
* - has a uiCanExit() component hook
* - is being exited
*
* If both are true, adds the uiCanExit component function as a hook to that singular Transition.
*/
private _invokeUiCanExitHook;
/** @internal */
requestUpdate(...args: Parameters): void;
/**
* For each transition, checks if any param values changed and notify component
*/
private _invokeUiOnParamsChangedHook;
/** @internal */
get viewContext(): ViewContext | undefined;
/** @internal */
get state(): StateDeclaration;
/**
* Reports a missing provider once this view has actually rendered nothing.
*
* Deliberately here rather than at the failed seek in `setupUiView`: the seek
* runs in `connectedCallback`, and custom-element upgrade order is not
* guaranteed, so a correct app can connect a `` before ``
* upgrades. By the first completed update the no-op is observable.
*
* @internal
*/
protected firstUpdated(changed: PropertyValues): void;
/** @internal */
render(): Node | TemplateResult;
}
export interface UiView {
/** @internal */
constructor: typeof UiView;
}
//# sourceMappingURL=ui-view.d.ts.map