import { Logging } from "@intelligentgraphics/ig.utilities";
import { Connector } from "./Connector";
import { EDialogResult, EMessageBoxType } from "./EDialogTypes";
import { IHostInfo } from "./ESessionState";
import { IDataCallback } from "./IDataCallback";
import { IShowSaveDialogParameters } from "./IShowSaveDialogParameters";
/**
 * Base class for all Pages.
 * A page in this context is a functionally complete step in an
 * interactive planning process AKA wizard step.
 * It should be created when a corresponend HTML page is loaded and it
 * needs an instance of IConnector as parameter.
 */
export declare class Page {
    /**
     * Member to store the Connector object
     */
    private _connector;
    /**
     * Stores a callback method to be executed before the page context will be
     * lost. Use it to save page states etc.
     */
    private _onBeforePageChange;
    /** Basic information about host, module.json etc. Initialized in constructor (async!). */
    private _hostInfo;
    /**
     * Constructor. Don't put your application's code in the constructor
     * of you derived Page class, as vital functions like HostInfo() are
     * not available here. Instead, override the protected function
     * initialize() and put your code there.
     */
    constructor();
    /**
     * Override this method in your application's derived page class, doing
     * the stuff needed to be done first upon loading the page.
     */
    protected initialize(): void;
    /**
     * Returns the initialized Connector object.
     */
    readonly Connector: Connector;
    /**
     * Returns the OnBeforePageChange callback.
     */
    /**
    * Sets the OnBeforePageChange callback.
    * @param param Callback method to be called when the
    *        OnBeforePageChange function finishes. Return false when the
    *        page is not allowed to change.
    */
    OnBeforePageChange: (cb: IDataCallback<boolean>) => void;
    getHostParameters(callback?: IDataCallback<IHostInfo>): void;
    /**
     * Executes log() with the scope IGD_log.ELogScope.App
     * @param level Severity of the message
     * @param message The log message(s).
     */
    appLog(level: Logging.ELogLevel, ...message: any[]): void;
    /**
     * Tells the Host the module wants to be finished and the data should be submitted.
     */
    submit(): void;
    /**
     * Tells the Host the module wants to be finished without submission of data.
     */
    cancel(): void;
    /**
     * Tells the Host to store the state of the current page.
     * @param state Any variable. Most certainly an object.
     * @param callback Callback function with boolean parameter, which is true when the command succeeded.
     */
    storePageState(state: any, callback?: IDataCallback<boolean>): void;
    /**
     * Tells the Host to send back a previously stored state of the current page.
     * @param callback Callback function with the returned data as parameter.
     */
    restorePageState(callback: IDataCallback<any>): void;
    /**
     * Tells the Host to store the state of the whole dialog (accessible on any page).
     * @param state Any variable. Most certainly an object.
     * @param callback Callback function with boolean parameter, which is true when the command succeeded.
     */
    storeSessionState(state: any, callback?: IDataCallback<any>): void;
    /**
     * Tells the Host to add the given state to the storage of the whole dialog (accessible on any page).
     * @param state Any variable. Most certainly an object.
     * @param callback Callback function with boolean parameter, which is true when the command succeeded.
     */
    addSessionState(state: any, callback?: IDataCallback<any>): void;
    /**
     * Tells the Host to send back a previously stored state of the whole dialog.
     * @param callback Callback function with the returned data as parameter.
     */
    restoreSessionState(callback: IDataCallback<any>): void;
    /**
     * Tells the Host to store an object session-independend.
     * @param state A stringify-able object.
     * @param callback Callback function with boolean parameter, which is true when the command succeeded.
     */
    storeClientState(state: Object, callback?: IDataCallback<boolean>): void;
    /**
     * Tells the Host to add the given state to the session-independend storage.
     * @param state A stringify-able object.
     * @param callback Callback function with boolean parameter, which is true when the command succeeded.
     */
    addClientState(state: Object, callback?: IDataCallback<boolean>): void;
    /**
     * Tells the Host to send back a previously stored state of the session-independend client.
     * @param callback Callback function with the returned data as parameter.
     */
    restoreClientState(callback: IDataCallback<Object>): void;
    /**
     * Tells the Host the page to load, when the user clicks on the
     * "next" button. Submit an empty url to disable the "next" button.
     * @param path relative path to the next page.
     * @param callback Callback function with boolean parameter, which is
     *                 true when the "next"-button is enabled as
     *                 consequence of the call.
     */
    setNextPage(path: string, callback?: IDataCallback<boolean>): void;
    /**
     * Tells the Host to load the given page immediatly and optionally set progress
     * @param param string with path or object with path and/or newProgress and/or rollBackHistory.
     * @param callback Callback function with boolean parameter, which is
     *                 false when command failed (invalid path).
     */
    jumpToPage(param: {
        url: string;
        newProgress?: number;
        rollBackHistory?: boolean;
    }, callback?: IDataCallback<boolean>): void;
    jumpToPage(param: string, callback?: IDataCallback<boolean>): void;
    /**
     * Tells the Host to set a progress percentage. 100 means the Module can
     * be completed. This must be taken into account by the host.
     * @param newProgress progress percentage from 0 to 100.
     * @param callback Callback function with number parameter, which
     *                 contains the progress set by the Host (maybe the
     *                 value had to be corrected)
     */
    setProgress(newProgress: number, callback?: IDataCallback<number>): void;
    /**
     * Tells the Host to return the current progress percentage.
     * @param callback Callback function with number parameter, which
     *                 contains the progress.
     */
    getProgress(callback: IDataCallback<number>): void;
    /**
     * Returns the current page url.
     * @param callback Callback function with string parameter.
     */
    getCurrentPageUrl(callback: IDataCallback<string>): void;
    /**
     * Get the localized resources for this page.
     * @param callback Callback function with the returned data or null, as parameter.
     */
    getTextResources(callback: IDataCallback<any>): void;
    /**
     * Get the content of a JSON file or multiple JSON files.
     * @param file Path to file or an Array of files, relative to the
     * Module root.
     * @param finishCallback Callback function with the returned data or
     * null, as parameter. In case of a bulk-request (file parameter is an
     * array with n elements), this function has n parameters, one for each
     * response and in the same order as the filenames in the file array.
     * @param progressCallback Each time a file reading is completed, this
     * callback function is executed with the number of the remaining files
     * as parameter.
     */
    getJsonFile(file: string, finishCallback: IDataCallback<any>, progressCallback?: IDataCallback<number>): void;
    getJsonFile(file: string[], finishCallback: (...res: any[]) => void, progressCallback?: IDataCallback<number>): void;
    /**
     * Get the content of a localized JSON file.
     * @param file Path to file, relative to the Module root. Without language dependant parts. E.g. test.json
     * @param callback Callback function with the returned data or null, as parameter.
     */
    getJsonFileLocalized(file: string, callback: IDataCallback<any>): void;
    /**
     * Get an image file.
     * @param file Path to image file, relative to the Module root.
     * @param callback Callback function with the returned data or null, as parameter.
     */
    getImageFile(file: string, callback: IDataCallback<any>): void;
    /**
     * Get the content of a text file or multiple text files.
     * @param file Path to file or an Array of files, relative to the
     * Module root.
     * @param finishCallback Callback function with the returned data or
     * null, as parameter. In case of a bulk-request (file parameter is an
     * array with n elements), this function has n parameters, one for each
     * response and in the same order as the filenames in the file array.
     * @param progressCallback Each time a file reading is completed, this
     * callback function is executed with the number of the remaining files
     * as parameter.
     */
    getTextFile(file: string, finishCallback: IDataCallback<string>, progressCallback?: IDataCallback<number>): void;
    getTextFile(file: string[], finishCallback: (...res: string[]) => void, progressCallback?: IDataCallback<number>): void;
    /**
     * Requests the Host to validate the passed user credentials.
     * @param state Should contain string objects 'login' and 'password'.
     * @param callback Callback function with boolean parameter, which is true when the credentials are valid.
     */
    validateUserCredentials(state: any, callback: IDataCallback<boolean>): void;
    /**
     * Shows a message box to the user.
     * @param text Message to be shown,
     * @param type Dialog type
     * @param callback Callback function with the dialog result as parameter.
     */
    showMessageBox(text: string, type: EMessageBoxType, callback: IDataCallback<EDialogResult>): void;
    /**
     * The host should save the given state in some way. How exactly is
     * unspecified here.
     * @param state The object to be saved. If this parameter is undefined,
     * the current sessionstate will be saved.
     * @param callback Callback function with boolean parameter, which is true
     * when the host saved the state successfully.
     */
    saveModuleState(state: any, callback: IDataCallback<boolean>): void;
    /**
     * The host should load a formerly saved state in some way. How exactly is
     * unspecified here.
     * @param callback Callback function. On unsuccessful load, the callback
     * parameter will be false, otherwise the loaded object.
     */
    loadModuleState(callback: IDataCallback<any>): void;
    /**
     * Tells the Host to initiate outside import
     */
    initiateImportFromUniversal(): void;
    /**
     * Tells the Host to initiate outside load
     */
    initiateLoadFromUniversal(): void;
    /**
     * Tells the Host to initiate outside save or export
     */
    initiateSaveToUniversal(): void;
    /**
     * Tells the Host to initiate outside save or export
     */
    showSaveDialog(params: IShowSaveDialogParameters, cb: IDataCallback<boolean>): void;
    /**
     * Change host properties like CurrentLocale. Support for this must be implemented in the host.
     * @param params Parameters to be changed.
     * @param cb Function to be called when command has finished.
     */
    setHostProperties(params: any, cb: IDataCallback<boolean>): void;
    /** access is deprecated, use IGD.Core.Page.CurrentPage instead */
    static Page: Page;
    static createPage(pageClassName: string): Page | undefined;
    /** Access current page instance */
    static readonly CurrentPage: Page;
    /** Access host information */
    readonly HostInfo: IHostInfo;
    static getJSONFile(path: string): Promise<object>;
}
