import { HotFile } from "./HotFile";
import { HotPage } from "./HotPage";
import { HotAPI } from "./HotAPI";
import { HotTestElement } from "./HotTestElement";
import { HotEventMethod } from "./HotRouteMethod";
import EventEmitter from "events";
import DOMPurify from "dompurify";
import Cookies from "js-cookie";
/**
 * The available developer modes.
 */
export declare enum DeveloperMode {
    /**
     * The default developer mode. No tests will be executed and
     * any test related data will be ignored.
     */
    Production = 0,
    /**
     * For use during development/debugging. All test data will
     * be collected and executed if necessary.
     */
    Development = 1
}
/**
 * A CSS object to embed.
 */
export interface CSSObject {
    /**
     * The url to the CSS file to embed.
     */
    url: string;
    /**
     * The integrity hash to generate during initial compilation.
     */
    integrityHash: string;
}
/**
 * The SSE emitter.
 */
type HotSSEEmitter = {
    "open": [Response];
    "error": [Error];
    "message": [any];
    "close": [];
};
/**
 * The api used during processing.
 */
export declare class Hot {
    /**
     * The JSDOM window that is meant to only be used internally by HotStaq on the server side and should not be used.
     */
    static __purifyWindow: any;
    /**
     * The DOMPurify object that is meant to only be used internally by HotStaq on the server and should not be used.
     */
    static __domPurify: any;
    /**
     * Debugging, testing, and benchmarking related options.
     */
    static Debugger: {
        /**
         * If set to true, whenever HotFile.process is called, performance.now() will be called
         * and the time taken to process the file will be logged to the console. In addition the number
         * of times process has been called will be stored in Hot.Debugger.processCount.
         */
        benchmark: boolean;
        /**
         * The number of times the process function has been called. This is used for benchmarking purposes.
         */
        processCount: number;
        /**
         * The total amount of time that has been spent processing files. This is used for benchmarking purposes.
         */
        processTotalTime: number;
        /**
         * The average time spent processing files. This is used for benchmarking purposes.
         */
        processAvgTime: number;
    };
    /**
     * The currently generated page being displayed. This is cleared between every file processed.
     */
    static CurrentPage: HotPage;
    /**
     * The arguments passed.
     */
    static Arguments: any;
    /**
     * The mode in which this application is running. If it's set to development mode, all testing
     * related data will be collected, parsed, and executed if necessary.
     */
    static DeveloperMode: typeof DeveloperMode;
    /**
     * The mode in which this application is running. If it's set to development mode, all testing
     * related data will be collected, parsed, and executed if necessary.
     */
    static HotTestElement: typeof HotTestElement;
    /**
     * The mode in which this application is running. If it's set to development mode, all testing
     * related data will be collected, parsed, and executed if necessary.
     */
    static Mode: DeveloperMode;
    /**
     *The current API used on this page. This is cleared between every file processed.
     */
    static API: HotAPI;
    /**
     * The API being used by the tester.
     */
    static TesterAPI: HotAPI;
    /**
     * Contains the buffer to output. This is cleared between every file processed.
     */
    static Output: string;
    /**
     * The data to share across all the different files and pages. This data will be public.
     */
    static Data: any;
    /**
     * The cookies to use between pages.
     */
    static Cookies: Cookies.CookiesStatic;
    /**
     * Any public keys that need to be shown. These can be passed from HotSite.json.
     */
    static PublicKeys: any;
    /**
     * The CSS string to use when echoing out the CSS files.
     */
    static cssStr: string;
    /**
     * The CSS files to use in the current page being generated.
     *
     * @todo Make this a "string | CSSObject" data type so it can also include
     * the integrity hashes as well.
     */
    static CSS: string[];
    /**
     * The JavaScript files to use in the current page being generated.
     *
     * @todo Make this a "string | JSFileObject" data type so it can also include
     * the integrity hashes as well.
     */
    static JSFiles: any[];
    /**
     * The JavaScript inline code to use in the current page being generated.
     */
    static JSScripts: any[];
    /**
     * The JavaScript string to use when echoing out the Scripts files.
     */
    static jsFileStr: string;
    /**
     * The JavaScript string to use when echoing out the Scripts files.
     */
    static jsScriptsStr: string;
    /**
     * Get a validated URL parameter.
     *
     * @example
     * ```ts
     * <*
     * 	const id = Hot.getUrlParam ('id', 'int');
     * *>
     *
     * <div>The id is: ${id}</div>
     * ```
     *
     * @param validation This parameter is for validating and sanitizing a URL parameter.
     * If it's a string, the available options are:
     * * int
     *   * This will only allow integers. parseInt will be called and will return an integer.
     * * float
     *   * This will only allow floating point numbers. parseFloat will be called and will return a float.
     * * email
     *   * Will verify that the string is in the form of an email address.
     * * phone
     *   * Will verify that the string is in the form of an email address.
     * * uuid
     *   * This will verify that the string is in the form of a UUID. It does not check if the UUID is valid.
     * * string(number_of_chars)
     *   * This will only allow a string of the specified number of characters.
     *
     * If this is a function, this will call the supplied function to validate. Validation checks must happen
     * in the function and return the sanitized value. It is simply a passthrough, be wise with this. Throw
     * an error if the value is not valid.
     *
     * @returns Returns the URL parameter, only if it passes validation. If the parameter is not found,
     * null will be returned.
     */
    static getUrlParam(param: string, validation: string | ((param: any) => any)): any;
    /**
     * Navigate to a route using SPA mode. This is a convenience wrapper
     * around HotStaq.navigateTo().
     *
     * @param path The URL path to navigate to (e.g. "/proposals").
     */
    static navigateTo(path: string): Promise<void>;
    /**
     * Retrieve a file and echo out it's contents.
     */
    static include(file: HotFile | string, args?: any[]): Promise<void>;
    /**
     * Include and execute JavaScript for use when running the preprocessor.
     */
    static includeJS(file: HotFile | string, args?: any[], parentObject?: any): Promise<any>;
    /**
     * Retrieve a file and echo out it's contents.
     */
    static import(moduleName: string, args?: any[], parentObject?: any): Promise<any>;
    /**
     * Run an already loaded file and echo out it's contents.
     */
    static runFile(fileName: string, args?: any[]): Promise<void>;
    /**
     * Get the content of a file.
     */
    static getFile(path: HotFile | string, args?: any[]): Promise<string>;
    /**
     * Make an api call. This must include the route version.
     *
     * Simple apiCall:
     * @example
     * ```ts
     * await Hot.apiCall ('/v1/hello_world/echo', { message: "Hello!" });
     * ```
     *
     * Make an API call and upload a file:
     * @example
     * ```ts
     * let input = document.getElementById ("fileInput");
     * let file = input.files[0];
     *
     * await Hot.apiCall ('/v1/hello_world/echo',
     * 		{ message: "Hello!" }, HotEventMethod.POST,
     * 		{
     * 			"indexFileKey": file
     * 		});
     * ```
     */
    static apiCall(route: string, data?: any, httpMethod?: HotEventMethod, files?: {
        [name: string]: any;
    }, bearerToken?: string): Promise<any>;
    /**
     * Make a HTTP SSE JSON request. This will await until a connection is established.
     *
     * @example
     * ```ts
     * await Hot.sseRequest ('/v1/hello_world/echo', { message: "Hello!" });
     * ```
     *
     * @param url The full url to make the HTTP call.
     * @param data The data to JSON.stringify and send.
     * @param httpMethod The HTTP method to use to send the data.
     *
     * @returns The parsed JSON object.
     */
    static sseRequest(request: {
        url: string;
        data?: any;
        bearerToken?: string;
        httpMethod?: HotEventMethod;
        ctrl: AbortController;
        autoParseMsgs?: boolean;
        echoErrorToConsole?: boolean;
    }): EventEmitter<HotSSEEmitter>;
    /**
     * Get a HTTP JSON file or request using HTTP GET.
     *
     * @example
     * ```ts
     * await Hot.getJSON (`http://example.com/example.json`);
     * ```
     *
     * @param url The full url to make the HTTP call.
     *
     * @returns The parsed JSON object.
     */
    static getJSON(url: string, bearerToken?: string): Promise<any>;
    /**
     * Make a HTTP JSON request.
     *
     * @example
     * ```ts
     * await Hot.jsonRequest ('/v1/hello_world/echo', { message: "Hello!" });
     * ```
     *
     * @param url The full url to make the HTTP call.
     * @param data The data to JSON.stringify and send.
     * @param httpMethod The HTTP method to use to send the data.
     *
     * @returns The parsed JSON object.
     */
    static jsonRequest(url: string, data?: any, bearerToken?: string, httpMethod?: HotEventMethod): Promise<any>;
    /**
     * Make a HTTP request. This is basically just a wrapper for fetch that can also upload files.
     *
     * @example
     * HTTP JSON POST
     * ```ts
     * await Hot.httpRequest ('http://other-hotstaq-api.com/v1/hello_world/echo', { message: "Hello!" });
     * ```
     *
     * @example
     * Upload file using HTTP POST
     * ```ts
     * let input = document.getElementById ("fileInput");
     * let file = input.files[0];
     *
     * await Hot.httpRequest ('http://other-hotstaq-api.com/v1/hello_world/echo',
     * 		{ message: "Hello!" }, HotEventMethod.POST,
     * 		{
     * 			"indexFileKey": file
     * 		});
     * ```
     */
    static httpRequest(url: string, data: any, httpMethod?: HotEventMethod, files?: {
        [name: string]: any;
    }, bearerToken?: string): Promise<any>;
    /**
     * Echo out some output. This uses DOMPurify to sanitize the output, you can pass
     * a configuration object to DOMPurify to change the sanitization behavior.
     */
    static echo(message: string, cfg?: DOMPurify.Config): void;
    /**
     * Echo out some output. Use this if you intend to output HTML that is not escaped.
     */
    static echoUnsafe(message: string): void;
    /**
     * Echo out the CSS for the current page being generated.
     */
    static displayCSS(): void;
    /**
     * Echo out the JS files for the current page being generated.
     */
    static displayJSFiles(): void;
    /**
     * Echo out the JS scripts for the current page being generated.
     */
    static displayJSScripts(): void;
}
export {};
//# sourceMappingURL=Hot.d.ts.map