import { AppStateKeyed, Page, PageProvider } from "@openremote/or-app";
import { TemplateResult } from "lit";
import { Task } from "@lit/task";
import { Store } from "@reduxjs/toolkit";
import { OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";
import { Asset, GatewayTunnelInfo, GatewayTunnelInfoType } from "@openremote/model";
export declare function pageGatewayTunnelProvider(store: Store<AppStateKeyed>): PageProvider<AppStateKeyed>;
export declare class PageGatewayTunnel extends Page<AppStateKeyed> {
    protected GATEWAY_TUNNEL_TYPES: string[];
    protected GATEWAY_TUNNEL_PROTOCOL_TYPES: GatewayTunnelInfoType[];
    protected _realm: string;
    protected _loading: boolean;
    protected _refreshTimer?: number;
    static get styles(): import("lit").CSSResult[];
    disconnectedCallback(): void;
    get name(): string;
    stateChanged(state: AppStateKeyed): void;
    protected render(): TemplateResult;
    /**
     * Function that returns an HTML {@link TemplateResult} with a table.
     * Displays the given {@link tunnels} parameter in a nice looking format.
     * Uses the {@link OrMwcTable} component for displaying
     */
    protected getTunnelsTable(tunnels?: GatewayTunnelInfo[]): Promise<TemplateResult>;
    /**
     * Function that returns an HTML {@link TemplateResult} containing the gateway asset that is linked to the {@link tunnel}.
     */
    protected _getTunnelGatewayIdTemplate(tunnel: GatewayTunnelInfo): Promise<TemplateResult | string>;
    /**
     * Function that returns an HTML {@link TemplateResult} containing the actions for the given {@link tunnel}.
     */
    protected _getTunnelActionsTemplate(tunnel: GatewayTunnelInfo): Promise<TemplateResult | string>;
    /**
     * HTML callback event of the 'stop' button in the tunnels table,
     * meant to stop and delete the constructed tunnel.
     */
    protected _onStopTunnelClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo): void;
    /**
     * Function that requests the manager to stop the {@link tunnel}.
     */
    protected _stopTunnel(tunnel: GatewayTunnelInfo): Promise<boolean>;
    /**
     * HTML callback event for the 'copy address' button in the tunnels table,
     * meant for TCP addresses to be copied to the browsers' clipboard.
     */
    protected _onCopyTunnelAddressClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo): void;
    /**
     * HTML callback event of the 'open' button in the tunnels table,
     * meant to start tunneling towards that instance
     */
    protected _onOpenTunnelClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo): void;
    /**
     * HTML callback event of the 'add' button above the tunnels table,
     * meant to start a tunnel towards that instance.
     */
    protected _onAddTunnelClick(ev: OrInputChangedEvent): void;
    /**
     * Function that attempts to start a new {@link tunnel}, but requires checking of its fields beforehand,
     * making sure the correct details are sent towards the {@link _startTunnel()} method.
     */
    protected _tryStartTunnel(tunnel: GatewayTunnelInfo): void;
    /**
     * Function that requests the manager to start a new {@link tunnel}.
     */
    protected _startTunnel(tunnel: GatewayTunnelInfo): Promise<boolean>;
    /**
     * Function that opens a web page through the tunnel (in a new browser tab)
     */
    protected _navigateToTunnel(info: GatewayTunnelInfo): void;
    /**
     * Internal function to get the tunnel address based on {@link GatewayTunnelInfo}
     */
    protected _getTunnelAddress(info: GatewayTunnelInfo): string | undefined;
    /**
     * Internal Lit {@link Task} meant for fetching the list of tunnels.
     * It acts as a reactive controller, and keeps its value cached.
     */
    protected _fetchTunnelsTask: Task<readonly [string], GatewayTunnelInfo[]>;
    /**
     * Internal asynchronous function to fetch the list of tunnels.
     */
    protected _fetchTunnels(realm?: string, _signal?: AbortSignal): Promise<GatewayTunnelInfo[]>;
    /**
     * Sets a timeout to refresh the tunnels whenever the next tunnel is automatically closed.
     */
    protected _updateRefreshTimer(tunnels?: GatewayTunnelInfo[]): void;
    /**
     * Utility function to fetch the available gateway assets to select from
     */
    protected _fetchGatewayAssets(requireTunnelSupport?: boolean): Promise<Asset[]>;
    /**
     * Utility function that returns the default values of a new tunnel.
     */
    protected _getDefaultTunnelToAdd(): GatewayTunnelInfo;
}
