import { ServableFileExtension } from "./HotHTTPServer";
/**
 * A map path for testing.
 */
export interface HotSiteMapPath {
    /**
     * If set to true, this will start automatically when tests start.
     * The default is true.
     */
    autoStart?: boolean;
    /**
     * The path to the
     */
    path?: string;
}
/**
 * A route used in a HotSite.
 */
export interface HotSiteRoute {
    /**
     * The name of the route. Will appear in the title.
     */
    name: string;
    /**
     * The url to the file to load.
     */
    url: string;
    /**
     * The name of the API to interface with.
     */
    api?: string;
    /**
     * The order in which destinations are supposed to execute. This is
     * ignored if the destinations are an array.
     */
    destinationOrder?: string[];
    /**
     * The HotTesterMap to use. This can be the name of an
     * existing one attached to the selected tester, or
     * can be an array of destinations that will be used to
     * create a new map.
     */
    map?: string | string[] | {
        [name: string]: string | HotSiteMapPath;
    } | HotSiteMapPath[];
}
/**
 * Preload tier for a web route in the v0.9.0 static build.
 *
 * - `eager` — template inlined into index.html stash, preamble in app.js bundle (default)
 * - `lazy` — template + preamble ship in app-route-{slug}.js, prefetched on hover/focus
 * - `never` — same as lazy but no prefetch; loads on click
 */
export type HotSiteWebRoutePreload = "eager" | "lazy" | "never";
/**
 * A v0.9.0 static-build web route. SSR mode ignores the static-specific
 * fields; they only take effect when `hotstaq build --static` runs.
 */
export interface HotSiteWebRoute {
    /** URL path the route is served at, e.g. `/login`. */
    path: string;
    /** Path to the .hott file, relative to publicDir. */
    file: string;
    /** Preload tier; defaults to `eager`. */
    preload?: HotSiteWebRoutePreload;
    /**
     * When true, the compiler runs the preamble at build time against the
     * configured fixtures and bakes resulting HTML into the template stash.
     * For SEO-sensitive routes. Requires `fixtures`, `fixturesApi`, or
     * `fixturesScript`.
     */
    staticRender?: boolean;
    /** Static JSON fixture file used when `staticRender: true`. */
    fixtures?: string;
    /** Live preview API URL used when `staticRender: true`. */
    fixturesApi?: string;
    /** Script that returns fixture data at build time. */
    fixturesScript?: string;
}
/**
 * Explicit partial manifest entry for build-time Hot.include() resolution.
 */
export interface HotSiteWebPartial {
    /** Stable stash id, typically the path minus `.hott`. */
    id: string;
    /** Path to the partial source file, relative to publicDir. */
    src: string;
}
/**
 * v0.9.0 API client bundling configuration (HS090-8). Tells the static
 * builder how to find and wire the auto-generated Web API client into
 * the emitted app.js so preambles can call `hotCtx.api.route.method(...)`
 * without needing the legacy HotStaq.min.js global.
 */
export interface HotSiteWebApiClient {
    /**
     * HotSite.apis key whose library we load. Defaults to the first
     * apis entry when only one is present.
     */
    apiRef?: string;
    /**
     * Path to the generated client JS file, relative to publicDir.
     * Defaults to `./js/${libraryName}_${apiName}.js` (the path emitted
     * by `hotstaq generate --api`).
     */
    bundlePath?: string;
    /**
     * Base URL passed to the client constructor at runtime. Defaults to
     * HotSite.apis[apiRef].url.
     */
    baseUrl?: string;
}
/**
 * A HotSite to load. This SHOULD NOT contain any private secret keys, passwords,
 * or database connection information related to the server. As such, future
 * versions of the HotSite interface should not contain any database related
 * connection info.
 */
export interface HotSite {
    /**
     * The name of this HotSite.
     */
    name: string;
    /**
     * The version of this HotSite.
     */
    version?: string;
    /**
     * The description of this HotSite.
     */
    description?: string;
    /**
     * The path to the current HotSite. This is filled in during parsing.
     */
    hotsitePath?: string;
    /**
     * Additional web server configuration.
     */
    server?: {
        /**
         * The default name for a served Hott file.
         */
        name?: string;
        /**
         * If set to true, this will serve ALL files, including potentially secret files.
         */
        serveSecretFiles?: boolean;
        /**
         * Serve the following file extensions when requested.
         */
        serveFileExtensions?: (string | ServableFileExtension)[];
        /**
         * The name of the API to interface with across all pages.
         */
        globalApi?: string;
        /**
         * The base url for the server.
         */
        url?: string;
        /**
         * The JavaScript source path.
         */
        jsSrcPath?: string;
        /**
         * The interfaces to convert into IHotParameters.
         */
        interfaces?: {
            /**
             * The name of the interfaces to convert into JSON objects.
             */
            generate: string[] | {
                /**
                 * The interface name.
                 */
                name: string;
                /**
                 * The key in the JSON object that contains the interface.
                 */
                key?: string;
                /**
                 * Indicates if the key in the JSON object is required.
                 */
                required?: string;
            }[];
        };
        /**
         * The ports to use.
         */
        ports?: {
            /**
             * The web HTTP port to serve on.
             */
            http?: number;
            /**
             * The web HTTPS port to serve on.
             */
            https?: number;
            /**
             * If set to true, this will redirect from HTTP to HTTPS for a web and web-api server.
             */
            redirectHTTPtoHTTPS?: boolean;
            /**
             * The api HTTP port to serve on.
             */
            apiHttp?: number;
            /**
             * The api HTTPS port to serve on.
             */
            apiHttps?: number;
            /**
             * If set to true, this will redirect from HTTP to HTTPS for an api server.
             */
            apiRedirectHTTPtoHTTPS?: boolean;
        };
        /**
         * The list of directory to serve to the client from the server.
         */
        serveDirectories?: {
            /**
             * The web route to take.
             */
            route: string;
            /**
             * The local filesystem path to serve pages from.
             */
            localPath: string;
        }[];
        /**
         * How to handle errors.
         */
        errors?: {
            /**
             * On a 404, serve a local file.
             */
            on404?: string;
            /**
             * On an error other than a 404, serve a local file.
             */
            onOther?: string;
        };
    };
    /**
     * Testing related functionality.
     */
    testing?: {
        web?: {
            /**
             * The name of the tester to use.
             */
            testerName?: string;
            /**
             * The url that connects to the tester api server.
             */
            testerAPIUrl?: string;
            /**
             * The name of the test driver to use.
             */
            driver?: string;
            /**
             * The number of milliseconds to wait before executing the next command.
             * Default is set to 20.
             */
            commandDelay?: number;
            /**
             * The url to the html that loads the hott files.
             */
            launchpadUrl?: string;
            /**
             * The maps to test in order.
             */
            maps?: string[];
        };
        api?: {
            /**
             * The name of the tester to use.
             */
            testerName?: string;
            /**
             * The url that connects to the tester api server.
             */
            testerAPIUrl?: string;
            /**
             * The name of the test driver to use.
             */
            driver?: string;
            /**
             * The url to the html that loads the hott files.
             */
            launchpadUrl?: string;
            /**
             * The maps to test in order.
             */
            maps?: string[];
        };
    };
    /**
     * The routes to load. This MAY be deprecated in the future.
     */
    routes?: {
        [routeName: string]: HotSiteRoute;
    };
    web?: {
        [name: string]: {
            /**
             * The maps to test in order.
             */
            map?: string[];
            /**
             * The root URL served by this web app. Used by the v0.9.0
             * static builder to emit <base href> and the SPA router's
             * scope. Ignored by SSR mode.
             */
            mainUrl?: string;
            /**
             * Extra JavaScript files to include in the static build
             * output. Paths are relative to publicDir. SSR mode ignores.
             */
            jsFiles?: string[];
            /**
             * CSS files to concatenate into dist/app.[hash].css during
             * `hotstaq build --static` (HS090-7). Paths are resolved
             * relative to cwd, so entries can reach into node_modules
             * (e.g. `node_modules/@hotstaq/admin-panel/public/main.css`)
             * or live under publicDir. Order is preserved. SSR mode
             * ignores.
             */
            cssFiles?: string[];
            /**
             * v0.9.0 static build routes. Populated for apps that opt
             * into `hotstaq build --static`. SSR mode ignores these —
             * it still discovers routes via the filesystem crawl.
             */
            routes?: HotSiteWebRoute[];
            /**
             * Explicit partial manifest for build-time Hot.include()
             * resolution (HS090-15). Required when --static --strict
             * is used. SSR mode ignores.
             */
            partials?: HotSiteWebPartial[];
            /**
             * v0.9.0 API client wiring (HS090-8). When set, the
             * static builder copies the referenced client script
             * into dist/js/, emits a <script> tag in index.html,
             * and calls registerApi() on `new libraryName[apiName]`
             * so preambles access it via `hotCtx.api`.
             */
            apiClient?: HotSiteWebApiClient;
        };
    };
    /**
     * The available APIs on the server. The server must already have these
     * loaded.
     */
    apis?: {
        [name: string]: {
            /**
             * The JS API file to load.
             */
            jsapi?: string;
            /**
             * The exported JS library name to use.
             */
            libraryName?: string;
            /**
             * The name of the api to use.
             */
            apiName?: string;
            /**
             * The port to use.
             */
            port?: number;
            /**
             * The public base url for the api.
             */
            url?: string;
            /**
             * The server-side filepath for the api.
             */
            filepath?: string;
            /**
             * The maps to test in order.
             */
            map?: string[];
        };
    };
    /**
     * Public keys that are embedded into the page.
     */
    publicKeys?: {
        [name: string]: string | {
            /**
             * The key of an API secret to pass to the site to
             * be used publicly.
             */
            passSecretFromAPI?: string;
            /**
             * Get the public secret from an environment variable.
             */
            env?: string;
        };
    };
    /**
     * The components to load and register.
     */
    components?: {
        [name: string]: {
            /**
             * The url to the component to load and register.
             */
            url: string;
        };
    };
    /**
     * The dependencies used by this application.
     */
    dependencies?: {
        /**
         * The web dependencies to load. These are loaded in the browser.
         */
        web?: {
            /**
             * The NPM dependency to load. The key is the name of the
             * NPM package and the value is the version to load.
             */
            [name: string]: string;
        };
        /**
         * The path to the web export that contains the BuildAssets function
         * to execute.
         */
        webExport?: string;
    };
    /**
     * The files to load and save in memory.
     */
    files?: {
        [name: string]: {
            /**
             * The url to the file to load.
             */
            url: string;
        };
    };
    /**
     * If set to true, this will disable loading files into memory.
     */
    disableFileLoading?: boolean;
}
//# sourceMappingURL=HotSite.d.ts.map