import * as React from "react";
import { LayoutCapabilities } from "../api/registry/layout";
import { IExternalBaseLayer, IBranchedMapSubState, ClientKind, InitError, IMapViewer, Dictionary } from "../api/common";
import { IInitAppLayout } from "../actions/init";
import { LegendNodeExtraHTMLProps } from "../components/context";
import { IElementState } from '../actions/defs';
import { IViewerInitCommand } from '../actions/init-command';
import { ApplicationDefinition } from '../api/contracts/fusion';
import { MapGroup, MapLayer } from "../api/contracts/runtime-map";
export interface SelectionOptions {
    allowHtmlValues?: boolean;
    cleanHtml?: (value: string) => string;
}
/**
 * @since 0.14.9
 */
export interface LegendOptions {
    /**
     * Provide extra HTML elements to insert before a layer name in a layer legend node
     *
     * Please note: If the HTML returned by this function would contain potentially untrusted input, you
     * are responsible for sanitizing the HTML content. The given options contains a sanitize function for
     * you to sanitize untrusted parts of the HTML content being assembled.
     *
     * @param options
     */
    provideExtraLayerIconsHtml?: (options: LegendNodeExtraHTMLProps<MapLayer>) => string[];
    /**
     * Provide extra HTML elements to insert before a group name in a group legend node
     *
     * Please note: If the HTML returned by this function would contain potentially untrusted input, you
     * are responsible for sanitizing the HTML content. The given options contains a sanitize function for
     * you to sanitize untrusted parts of the HTML content being assembled.
     *
     * @param options
     */
    provideExtraGroupIconsHtml?: (options: LegendNodeExtraHTMLProps<MapGroup>) => string[];
}
/**
 * @since 0.14.9 Extracted out to separate interface
 */
export interface IInitialElementVisibility {
    taskpane: boolean;
    legend: boolean;
    selection: boolean;
}
/**
 * MapGuide-specific application options
 *
 * @export
 * @interface IMapGuideAppProps
 * @since 0.14
 */
export interface IMapGuideAppProps {
    /**
     * A session id to init this viewer with
     */
    session?: string;
    /**
     * The mapagent URI
     *
     * @type {string}
     * @memberof IMapGuideAppProps
     */
    agentUri: string;
    /**
     * The agent kind
     *
     * @type {ClientKind}
     * @memberof IMapGuideAppProps
     */
    agentKind?: ClientKind;
    /**
     * The base URL for fusion. Used to determine the paths to the PHP backends for servicing tools like buffer/theme/featureinfo/redline/theme/etc
     */
    fusionRoot: string;
    /**
     * Settings that control the selection panel (if provided by the template)
     */
    selectionSettings?: SelectionOptions;
    /**
     * Settings that control the legend (if provided by the template)
     */
    legendSettings?: LegendOptions;
    /**
     * Defines initial element visibility
     */
    initialElementVisibility: IInitialElementVisibility;
}
/**
 * Describes an ad-hoc layout template
 *
 * @since 0.14
 */
export declare type AdHocLayoutTemplate = {
    factory: (() => React.ReactNode);
    capabilities: LayoutCapabilities;
};
/**
 * App component properties
 *
 * @export
 * @interface IAppProps
 */
export interface IAppProps {
    /**
     * The command that will carry out viewer initialization
     *
     * @type {IViewerInitCommand}
     * @memberof IAppProps
     * @since 0.14
     */
    initCommand: IViewerInitCommand;
    /**
     * The layout to use
     * @since 0.14 type changed to include AdHocLayoutTemplate
     */
    layout: string | AdHocLayoutTemplate;
    /**
     * A resource id to a Web Layout or Application Definition or a function that will fetch the required Application Definition.
     *
     * @memberof IAppProps
     */
    resourceId: string | (() => Promise<ApplicationDefinition>);
    /**
     * The list of external base layers
     *
     * @type {IExternalBaseLayer[]}
     * @memberof IAppProps
     *
     * @remarks This option is for when you are passing in a Web Layout to the viewer, but you still want to provide external
     * base layers. If passing in an Application Definition, this option is redundant as the Application Definition itself can
     * define the set of external base layers
     */
    externalBaseLayers?: IExternalBaseLayer[];
    /**
     * If specified, tells the application to not sync the following URL params to the URL, and to skip
     * reading these params when initializing/refreshing.
     *
     * @type {string[]}
     * @memberof IAppProps
     * @since 0.14
     */
    urlPropsIgnore?: string[];
    /**
     * A callback function that will be called when the viewer has finished initializing
     */
    onInit?: (viewer: IMapViewer) => void;
    /**
     * The locale to use
     */
    locale?: string;
    /**
     * MapGuide-specific options
     *
     * @type {IMapGuideAppProps}
     * @memberof IAppProps
     * @since 0.14
     */
    mapguide?: IMapGuideAppProps;
    /**
     * @since 0.14.8
     */
    appSettings?: Dictionary<string> | undefined;
}
/**
 * App component state
 *
 * @export
 * @interface IAppState
 */
export interface IAppState {
    error: InitError | undefined;
    includeStack: boolean;
    initOptions: any;
    configuredLocale: string;
    map: IBranchedMapSubState | undefined;
    activeMapName: string | undefined;
    featureTooltipsEnabled: boolean;
}
/**
 * App component action dispatchers
 *
 * @export
 * @interface IAppDispatch
 */
export interface IAppDispatch {
    initLayout: (cmd: IViewerInitCommand, args: IInitAppLayout) => void;
    setElementVisibility: (states: IElementState) => void;
}
export declare const App: (props: IAppProps) => JSX.Element;
