import { HotPage } from "./HotPage";
import { HotFile } from "./HotFile";
import { HotComponent, IHotComponent } from "./HotComponent";
import { HotLog } from "./HotLog";
import { HotAPI } from "./HotAPI";
import { DeveloperMode } from "./Hot";
import { HotModule } from "./HotModule";
import { HotTester } from "./HotTester";
import { HotSite, HotSiteRoute } from "./HotSite";
import { HotRouteMethodParameter, HotValidation, HotEventMethod, ServerRequest } from "./HotRouteMethod";
import { ValidationOptions } from "./HotProcessInput";
/**
 * The options to use when starting a page.
 */
export interface HotStartOptions {
    /**
     * The Hott site to load.
     */
    url?: string;
    /**
     * The content to display.
     */
    content?: string;
    /**
     * The name of the page to load.
     */
    name?: string;
    /**
     * The processor to use to load the page.
     */
    processor?: HotStaq;
    /**
     * Any arguments to pass to the new page.
     */
    args?: any;
    /**
     * The name of the tester to use.
     */
    testerName?: string;
    /**
     * The name of the tester map to use.
     */
    testerMap?: string;
    /**
     * The base url for the tester api.
     */
    testerAPIBaseUrl?: string;
    /**
     * The url to the html that loads the hott file that's
     * pointed at the url above.
     */
    testerLaunchpadUrl?: string;
}
/**
 * TypeScript conversion options for converting interfaces into usable parameters.
 */
export interface ITypeScriptConversionOptions {
    /**
     * The type conversions to use when converting TypeScript types into
     * parameter types.
     */
    typeConversions?: {
        [typeName: string]: string;
    };
    /**
     * If set to true, the first union type will be returned. If set to false,
     * the entire union will be returned.
     */
    returnFirstUnionType?: boolean;
    /**
     * The default type to use when the available OpenAPI type is unknown or
     * is not a raw data type.
     */
    unknownTypeDefaultsToType?: string;
    /**
     * The path to the TypeScript config file to use when parsing the interface.
     * The interfaces must be in the project that the config file points to.
     */
    tsconfigPath?: string;
}
export type HotValidatorFunction = (((options: ValidationOptions, key: string, validation: HotValidation, value: any, request: ServerRequest) => IHotValidReturn) | ((options: ValidationOptions, key: string, validation: HotValidation, value: any, request: ServerRequest) => Promise<IHotValidReturn>));
export type HotRouteMethodParameterMap = {
    [propertyName: string]: HotRouteMethodParameter | (() => Promise<HotRouteMethodParameter>);
};
export declare enum HotValidReturnType {
    /**
     * Indicates that the value should be deleted.
     */
    Delete = 0,
    /**
     * Indicates that the value should be kept. This is the default value.
     */
    Return = 1,
    /**
     * Indicates that the value should be ignored.
     */
    Ignore = 2
}
export interface IHotValidReturn {
    /**
     * How this return should be handled.
     */
    type?: HotValidReturnType;
    /**
     * If set to any value, this will change the return type of the validation.
     */
    validationType?: string;
    /**
     * The value to be returned. This will only be used if the type is set to
     * Return or Ignore.
     */
    value?: any;
}
/**
 * Options for `HotStaq.installFetchInterceptors`. All fields are optional —
 * the bare-minimum install (with no options) just gives you the per-nav
 * AbortController, which is the universally-useful piece. The 401 hook is
 * opinionated session-out UX and is left to each app to wire up.
 */
export interface IHotFetchInterceptorOptions {
    /**
     * Request URLs that should bypass both the per-nav AbortController and
     * the 401 hook. A request is skipped if its URL starts with any string
     * here. Use this for endpoints that must survive SPA navigation (the
     * canonical case is OIDC's `/token` — silent token refresh shouldn't
     * die just because the user clicked a sidebar link mid-flight).
     */
    skipUrls?: string[];
    /**
     * Called when an authenticated `fetch(...)` returns a 401 response.
     * The handler runs after the response resolves; the response itself is
     * still returned to the original caller, so existing error-handling
     * paths in app code keep working. Use this to clear local credentials
     * and surface "your session expired" UX. Skipped for URLs in
     * `skipUrls` (those 401s are the responsibility of the refresh path).
     */
    on401?: (response: Response, request: RequestInfo, init: RequestInit) => void;
}
export interface ParsedInterface {
    type: string;
    typeName?: string;
    description: string;
    required: boolean;
    isReadOnly: boolean;
    isArray: boolean;
    parameters: {
        [propName: string]: ParsedInterface;
    };
    valids?: HotValidation[];
}
/**
 * The main class that handles all HTML preprocessing, then outputs the
 * results.
 */
export interface IHotStaq {
    /**
     * The api that's used to communicate with.
     */
    api?: HotAPI;
    /**
     * The tester api that's used to communicate with.
     */
    testerAPI?: HotAPI;
    /**
     * Indicates what type of execution this is.
     */
    mode?: DeveloperMode;
    /**
     * The pages that can be constructed.
     */
    pages?: {
        [name: string]: HotPage;
    };
    /**
     * The imported modules.
     */
    modules?: {
        [name: string]: HotModule;
    };
    /**
     * The components that can be constructed.
     *
     * @fixme Rename this to componentTags.
     */
    components?: {
        [tagName: string]: {
            componentType: (new (copy: IHotComponent | HotStaq, api?: HotAPI) => HotComponent);
            processor: HotStaq;
            api: HotAPI;
        };
    };
    /**
     * The files that can be stored for later use.
     */
    files?: {
        [name: string]: HotFile;
    };
    /**
     * The loaded hotsite.
     */
    hotSite?: HotSite;
}
/**
 * The main class that handles all HTML preprocessing, then outputs the
 * results.
 */
export declare class HotStaq implements IHotStaq {
    /**
     * The current version of HotStaq.
     */
    static version: string;
    /**
     * Indicates if this is a web build.
     */
    static isWeb: boolean;
    /**
     * Indicates if this is ready for testing.
     */
    static isReadyForTesting: boolean;
    /**
     * Executes this event when this page is ready for testing.
     */
    static onReadyForTesting: () => Promise<void>;
    /**
     * Executes this event when this page has received output for processing.
     *
     * @param output The output that is about to be used to generate the current page.
     */
    static onOutputReceived: (output: string) => void;
    /**
     * Executes this event when this page is ready for testing.
     *
     * @param output The output that was used to generate the current page.
     */
    protected static onReadyEvent: (output: string) => void;
    /**
     * If set to false, the page will not emit DOMContentLoaded or window.load.
     */
    static dispatchReadyEvents: boolean;
    /**
     * When SPA mode is enabled, navigating between routes will only replace
     * the content inside the target element instead of the entire page.
     * Set this to a CSS selector (e.g. "main", "#content") to enable SPA mode.
     * When null, full page replacement is used (default behavior).
     */
    static spaTarget: string;
    /**
     * The router manager that maps URL paths to .hott source files.
     * Populated by hotStaqWebStart when a `<hotstaq-router>` is present.
     */
    static routerManager: {
        [path: string]: {
            redirect?: string;
            baseRedirect?: string;
            base?: string;
            src?: string;
        };
    };
    /**
     * Wildcard routes for pattern matching.
     */
    static routerWildcards: string[];
    /**
     * The processor instance used for SPA navigation.
     */
    static spaProcessor: HotStaq;
    /**
     * If true, SPA link interception is active.
     */
    static spaEnabled: boolean;
    /**
     * Layout (app-shell) mode outlet selector. When set, the shell page (the
     * one hosting <hotstaq>) renders ONCE on full load and each route .hott is
     * content-only, injected into the element matching this selector. This
     * removes the need for app-side "bail if chrome already rendered" guards.
     * When null, the legacy spaTarget extraction mode is used. CSS selector,
     * e.g. "hot-outlet", "#main".
     */
    static spaOutlet: string;
    /**
     * True when an `outlet` was declared on <hotstaq> — selects the layout
     * (content-injection) navigation path instead of the legacy region
     * extraction. navigateTo branches on this, not on spaTarget.
     */
    static layoutEnabled: boolean;
    /**
     * Event fired before SPA navigation starts.
     * Return false to cancel the navigation.
     */
    static onBeforeNavigate: (path: string) => boolean | Promise<boolean>;
    /**
     * Event fired after an SPA navigation has rendered the new content,
     * but before HotStaq executes that content's inline <script> tags.
     *
     * Return `false` to take ownership of running those scripts yourself —
     * HotStaq will then skip its own execution pass. Returning `true`,
     * `undefined`, or having no handler at all lets HotStaq execute them
     * (the default), which is what makes inline page scripts run on SPA
     * navigation. See `onAfterUseOutput` for the full-render equivalent.
     */
    static onAfterNavigate: (path: string) => void | boolean | Promise<void | boolean>;
    /**
     * Event fired after `useOutput` has rendered a full document, but before
     * HotStaq executes that document's inline <script> tags. Same return-value
     * gate as `onAfterNavigate`: return `false` to run the scripts yourself;
     * otherwise HotStaq executes them.
     */
    static onAfterUseOutput: (output: string) => void | boolean | Promise<void | boolean>;
    /**
     * Override the framework's default 404 rendering.
     *
     * Called from `HotStaqWebStart` when the current URL doesn't match
     * any registered `<route>`, no `path="404"` or `path="*"` fallback
     * exists in the router, and the page boot would otherwise throw
     * "The hotstaq tag must have a src, HTML contents inside it, or a
     * router set."
     *
     * Set this to render a custom 404 (e.g. redirect to a branded page,
     * or call `HotStaq.useOutput` with your own HTML). When set, the
     * default fallback in `HotStaq.displayDefault404` is suppressed.
     *
     * Most apps should prefer registering a `path="404"` route in their
     * `<hotstaq-router>` instead — this hook is for cases where you
     * need to make a runtime decision (e.g. dispatch on the path).
     */
    static onRouteNotFound: (path: string) => void;
    /**
     * If true (the default), `enableSPA` automatically wires up fetch
     * interceptors that abort the previous page's pending requests when
     * the user navigates between SPA routes. Set this to false BEFORE the
     * `<hotstaq>` element runs (e.g. in a <script> earlier in <head>) to
     * opt out — useful if your frontend already wraps `window.fetch` and
     * doesn't want HotStaq to compose with it.
     */
    static autoInstallFetchInterceptors: boolean;
    /**
     * The current page's AbortController. Aborted on every SPA navigation
     * so previous-page fetches die before the new page's requests go out.
     * `installFetchInterceptors` populates this.
     */
    static navAbort: AbortController;
    /**
     * Internal: tracks whether `installFetchInterceptors` has wrapped
     * `window.fetch` and `onBeforeNavigate`. Exposed for tests; do not
     * toggle from app code.
     */
    protected static fetchInterceptorsInstalled: boolean;
    /**
     * Internal: most recent options passed to `installFetchInterceptors`,
     * read by the wrapped fetch on every call so apps can update
     * `skipUrls` / `on401` after install without re-wrapping.
     */
    protected static fetchInterceptorOptions: IHotFetchInterceptorOptions;
    /**
     * Errors to execute when something goes wrong.
     */
    static errors: {
        [name: string]: {
            redirectToUrl?: string;
            func?: (errType: string) => void;
        };
    };
    /**
     * The function to execute before validating any input. This is good for ensuring certain
     * users such as admins are allowed to skip validations when necessary.
     */
    static preValidate: ((options: ValidationOptions, key: string, validation: HotValidation, value: any, request: ServerRequest) => Promise<IHotValidReturn>);
    /**
     * The validations to perform on data.
     */
    static valids: {
        [name: string]: HotValidatorFunction | HotRouteMethodParameterMap;
    };
    /**
     * The function to execute after validating any input. This will not execute if a validation
     * has failed.
     */
    static postValidate: ((options: ValidationOptions, key: string, validation: HotValidation, value: any, request: ServerRequest) => Promise<IHotValidReturn>);
    /**
     * Indicates what type of execution this is.
     */
    mode: DeveloperMode;
    /**
     * The api that's used to communicate with.
     */
    api: HotAPI;
    /**
     * The tester api that's used to communicate with.
     */
    testerAPI: HotAPI;
    /**
     * The pages that can be constructed.
     */
    pages: {
        [name: string]: HotPage;
    };
    /**
     * The imported modules.
     */
    modules: {
        [name: string]: HotModule;
    };
    /**
     * The components that can be constructed.
     *
     * @fixme Rename this to componentTags.
     */
    components: {
        [tagName: string]: {
            componentType: (new (copy: IHotComponent | HotStaq, api?: HotAPI) => HotComponent);
            processor: HotStaq;
            api: HotAPI;
        };
    };
    /**
     * The files that can be stored for later use.
     */
    files: {
        [name: string]: HotFile;
    };
    /**
     * The loaded hotsite.
     */
    hotSite: HotSite;
    /**
     * The api content to use when about to load HotStaq.
     */
    apiContent: string;
    /**
     * The tester api content to use when about to load HotStaq.
     */
    testerApiContent: string;
    /**
     * The page content to use when about to load HotStaq.
     */
    pageContent: string;
    /**
     * The logger.
     */
    logger: HotLog;
    /**
     * Add a start delay before starting. This is for debugging purposes mostly.
     */
    startDelay: number;
    /**
     * The public keys to be exposed.
     */
    publicKeys: any;
    /**
     * The testers that will be used to execute tests.
     */
    testers: {
        [name: string]: HotTester;
    };
    constructor(copy?: IHotStaq);
    /**
     * Do a base validation check.
     */
    static baseValidator(options: ValidationOptions, key: string, validation: HotValidation, value: any, defaultStringLength?: number): boolean;
    /**
     * Setup the initial validators.
     */
    static setupValidators(): void;
    /**
     * Set a validator to be used.
     */
    static setValid(validName: string, validator: HotValidatorFunction | HotRouteMethodParameterMap): void;
    /**
     * Parse a boolean value. Accepts:
     *   - boolean (returned as-is — the previously-missing branch was
     *     dropping `true` to `false` because the function fell through
     *     to the bottom `return (false)` for `typeof value === "boolean"`)
     *   - number / bigint (0 → false, anything else → true)
     *   - string (case-insensitive "true"/"yes"/"yep" → true,
     *     "false"/"no"/"nah" / "" → false)
     *   - null / undefined → false
     *   - anything else → false
     */
    static parseBoolean(value: any): boolean;
    /**
     * Check whether a value is a valid RFC-4122 UUID (versions 1-5).
     *
     * This is the same strict check the `UUID` validator enforces, exposed as
     * a reusable boolean helper so client code can validate ids (e.g. a
     * `?id=` URL parameter) without catching the validator's thrown HttpError.
     */
    static isUUID(value: any): boolean;
    /**
     * The strict RFC-4122 (versions 1-5) UUID pattern shared by `isUUID` and
     * the `UUID` validator.
     */
    static uuidRegex: RegExp;
    /**
     * Remove elements already in the document that share an id with `subtree`
     * (or any of its descendants).
     *
     * A component placed via `documentSelector` lands OUTSIDE its own <tag> —
     * e.g. <admin-edit> appends its modal to <body>. On SPA navigation the
     * <tag> upgrades again and appends a SECOND copy with the same id, leaving
     * a stale orphan that id-based lookups (document.getElementById,
     * querySelector('#id'), bootstrap.Modal.getInstance('#id')) resolve to
     * instead of the live one. Call this with the incoming subtree BEFORE it is
     * inserted so only the fresh copy survives.
     *
     * `subtree` is expected to still be detached at call time; the contains()
     * guard keeps it (and anything inside it) safe regardless.
     */
    static removeStaleDuplicateIds(subtree: HTMLElement): void;
    /**
     * Sanitize an HTML string.
     */
    static sanitizeHTML(html: string): string;
    /**
     * Sanitize a JSON object by recursively encoding string values that are present
     * in the JSON to prevent XSS attacks.
     */
    static sanitizeJSON<T>(obj: T): T;
    /**
     * Recursively converts a ParsedInterface's parameters into a deep parameters map.
     * For an array property, the returned schema will have "type": "array" and an "items" property.
     * For object properties with nested parameters, a "properties" key is added.
     */
    static convertParsedInterfaceToParameters(parsed: ParsedInterface): HotRouteMethodParameterMap;
    /**
     * Convert a TypeScript interface to a route parameter. This is experimental, but still works decently.
     *
     * @param addToValids If this is set to true, the converted interface will be added to the valids list so it can be used to
     * help validate future data.
     */
    static convertInterfaceToRouteParameters(interfaceName: string | {
        name: string;
    }, addToValids?: boolean, options?: ITypeScriptConversionOptions): Promise<HotRouteMethodParameterMap>;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value.
     */
    static getParam(validate: string | HotValidation, name: string, objWithParam: any, request: ServerRequest, required?: boolean, throwException?: boolean, options?: ValidationOptions): Promise<any>;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value, ensure the
     * number returned is within a certain range.
     *
     * The value retrieved must be a number.
     */
    static getParamRange(validate: string | HotValidation, name: string, objWithParam: any, min: number, max: number, request: ServerRequest, required?: boolean, throwException?: boolean, options?: ValidationOptions): Promise<any>;
    static getParamDefault(validate: string | HotValidation, name: string, objWithParam: any, defaultValue: any, request: ServerRequest, options?: ValidationOptions): Promise<any>;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value, ensure the
     * number returned is within a certain range. If it does not exist, return a default value instead.
     *
     * The value retrieved must be a number.
     */
    static getParamDefaultRange(validate: string | HotValidation, name: string, objWithParam: any, defaultValue: any, min: number, max: number, request: ServerRequest, options?: ValidationOptions): Promise<any>;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value.
     */
    static getParamUnsafe(name: string, objWithParam: any, required?: boolean, throwException?: boolean): any;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value, ensure the
     * number returned is within a certain range.
     *
     * The value retrieved must be a number.
     */
    static getParamRangeUnsafe(name: string, objWithParam: any, min: number, max: number, required?: boolean, throwException?: boolean): any;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value.
     * If it does not exist, return a default value instead.
     */
    static getParamDefaultUnsafe(name: string, objWithParam: any, defaultValue: any): any;
    /**
     * Check if a required parameter exists inside an object. If it exists, return the value, ensure the
     * number returned is within a certain range. If it does not exist, return a default value instead.
     *
     * The value retrieved must be a number.
     */
    static getParamDefaultRangeUnsafe(name: string, objWithParam: any, defaultValue: any, min: number, max: number): any;
    /**
     * Check if a value is null or empty.
     *
     * @returns Returns true if the value is an empty string, null, undefined, 0, etc.
     */
    static checkIfEmpty(value: any): boolean;
    /**
     * Execute an error. This cannot be an async function due to the nature of how this works.
     */
    static executeError(errType: string): void;
    /**
     * Wait for a number of milliseconds.
     */
    static wait(numMilliseconds: number): Promise<void>;
    /**
     * Add a page.
     */
    addPage(page: HotPage): void;
    /**
     * Get a page to process.
     */
    getPage(pageName: string): HotPage;
    /**
     * Add an imported module.
     */
    addModule(name: string, module: HotModule): void;
    /**
     * Get an imported module.
     */
    getModule(name: string): HotModule;
    /**
     * Add a file.
     */
    addFile(file: HotFile): void;
    /**
     * Get a file.
     */
    getFile(name: string, throwEx?: boolean): HotFile;
    /**
     * Keep the context the object is currently in.
     *
     * @param func The document element's id.
     * @param context The object to remain in context.
     * @param [val=undefined] An additional value to pass to the context.
     * @return The returned result from the function func.
     */
    static keepContext(func: Function, context: any, val?: any): any;
    /**
     * Add and register a component.
     */
    addComponent(ComponentType: (new (copy: IHotComponent | HotStaq, api?: HotAPI) => HotComponent), api?: HotAPI, elementOptions?: ElementDefinitionOptions): void;
    /**
     * Correct any HTML prior to DOM parsing. This only accounts for <tr> currently.
     */
    static fixHTML(str: string): {
        fixedStr: string;
        querySelector: string;
    };
    /**
     * Add a new HTML element(s) to the current document. THIS IS UNSAFE TO DO DIRECTLY.
     */
    static addHtmlUnsafe(parent: string | HTMLElement | null, html: string | HTMLElement): HTMLElement | HTMLElement[];
    /**
     * Check if a HotSite's name is valid.
     */
    static checkHotSiteName(hotsiteName: string, throwException?: boolean): boolean;
    /**
     * In the supplied content, replace a key in a ${KEY} with a value.
     *
     * @returns The content with the correct values.
     */
    static replaceKey(content: string, key: string, value: string): string;
    /**
     * Convert a HotRouteMethodParameter type string to a JSON Schema type string.
     * Useful for generating MCP tool schemas, OpenAPI extensions, or any consumer
     * that needs JSON Schema types from HotStaq parameter definitions.
     */
    static convertParamTypeToJSONSchemaType(paramType: string): string;
    /**
     * Convert a HotRouteMethodParameter to a JSON Schema property definition.
     * Recursively handles nested objects and arrays.
     * Useful for generating MCP tool schemas, OpenAPI extensions, or any consumer
     * that needs JSON Schema from HotStaq parameter definitions.
     */
    static convertParamToJSONSchemaProperty(param: HotRouteMethodParameter): any;
    /**
     * Get the HTTP method string (e.g. "GET", "POST") from a HotEventMethod enum value.
     * Useful for MCP servers, API generators, and any consumer that needs to map
     * HotEventMethod values to HTTP method strings.
     */
    static getHTTPMethodFromEvent(type: HotEventMethod): string;
    /**
     * Get a value from a HotSite object.
     *
     * @returns Returns the value from the hotsite object. Returns null if it doesn't exist.
     */
    static getValueFromHotSiteObj(hotsite: HotSite, params: string[]): any;
    /**
     * Process a HotSite.
     */
    processHotSite(tester?: HotTester): Promise<void>;
    /**
     * Load from a HotSite.json file. Be sure to load and attach any testers before
     * loading a HotSite.
     */
    loadHotSite(path: string): Promise<void>;
    /**
     * Save the current HotSite to a file.
     */
    saveHotSite(path: string): Promise<void>;
    /**
     * Load an array of files. If a file already has content, it will not be reloaded
     * unless forceContentLoading is set to true.
     */
    loadHotFiles(files: {
        [name: string]: {
            url?: string;
            localFile?: string;
            content?: string;
        };
    }, forceContentLoading?: boolean, loadUrlContent?: boolean): Promise<void>;
    /**
     * Generate the content to send to a client.
     */
    generateContent(routeKey: string, name?: string, url?: string, jsSrcPath?: string, passArgs?: boolean, args?: any): Promise<string>;
    /**
     * Create the Express routes from the given pages. Be sure to load the
     * pages first before doing this. This method is meant to be used for
     * customized Express applications. If you wish to use the loaded routes
     * from this HotStaq object with HotHTTPServer, be sure to use
     * the loadHotSite method in HotHTTPServer.
     */
    createExpressRoutes(expressApp: any, jsSrcPath?: string): Promise<void>;
    /**
     * Add a tester for use later.
     */
    addTester(tester: HotTester): void;
    /**
     * Get the list of maps for testing from the HotSite.
     */
    getWebTestingMaps(): string[];
    /**
     * Get the list of maps for testing from the HotSite.
     */
    getAPITestingMaps(): string[];
    /**
     * Get a route's key from a route's name.
     */
    getRouteKeyFromName(name: string): string;
    /**
     * Get a route from a route's name.
     */
    getRouteFromName(name: string): HotSiteRoute;
    /**
     * Execute tests.
     *
     * @param testerName The tester to use to execute tests.
     * @param mapName The map or maps to use to navigate through tests.
     */
    executeTests(testerName: string, mapName: string): Promise<void>;
    /**
     * Execute all web tests from the HotSite testing web object.
     *
     * @param testerName The tester to use to execute tests.
     */
    executeAllWebTests(testerName: string): Promise<void>;
    /**
     * Execute all api tests from the HotSite testing api object.
     *
     * @param testerName The tester to use to execute tests.
     */
    executeAllAPITests(testerName: string): Promise<void>;
    /**
     * Process a page and get the result.
     */
    process(pageName: string, args?: any): Promise<string>;
    /**
     * Process a local file and get the result.
     */
    static processLocalFile(localFilepath: string, name?: string, args?: any): Promise<string>;
    /**
     * Process a url and get the result.
     */
    static processUrl(options: HotStartOptions): Promise<string>;
    /**
     * Process content and get the result.
     */
    static processContent(options: HotStartOptions): Promise<string>;
    /**
     * When the window has finished loading, execute the function.
     * This is meant for web browser use only.
     */
    static onReady(readyFunc: (output: string) => void): void;
    /**
     * Render a minimal "Page not found" page when no registered route
     * matches the current URL and no `path="404"` / `path="*"` fallback
     * is configured. Called by HotStaqWebStart's boot path; can also be
     * invoked directly.
     *
     * Apps that want a branded 404 should register a `<route path="404"
     * src="./404.hott">` (or `path="*"`) in their `<hotstaq-router>` —
     * the framework picks it up before falling back to this. For
     * runtime-decision 404 logic, set `HotStaq.onRouteNotFound`.
     */
    static displayDefault404(path: string): void;
    /**
     * Execute the <script> elements found within `root`.
     *
     * A <script> inserted into the DOM via `innerHTML` is inert — the HTML
     * spec only runs a script when it is *inserted into the document with
     * its content already present*. So after we swap new markup in (full
     * render or SPA partial swap), its inline scripts never ran. For each
     * not-yet-executed <script>, build a fresh element, copy `type`/`src`
     * and — for inline scripts — set `.text` BEFORE insertion, then swap it
     * in so the browser runs it.
     *
     * Each executed script is tagged `data-hotstaq-executed` and skipped on
     * any later pass, so calling this twice (or alongside an app that runs
     * some scripts itself) never double-fires one.
     */
    protected static executeInlineScripts(root: Document | HTMLElement): Promise<void>;
    /**
     * Replace the current HTML page with the output.
     * This is meant for web browser use only.
     */
    static useOutput(output: string): Promise<void>;
    /**
     * Inject a content-only route render into the live layout outlet.
     *
     * Used by `navigateTo` in layout (app-shell) mode. `output` is the processed
     * HTML of a content-only route .hott, so `DOMParser(output).body.innerHTML`
     * IS exactly the content — there's no region to extract and no fallback that
     * could pull in body-level chrome. Returns the live outlet element, or null
     * if no element matches `outletSelector` (caller falls back to a full render).
     *
     * @param output Processed content-only route HTML.
     * @param outletSelector CSS selector for the outlet element in the live shell.
     */
    protected static injectIntoOutlet(output: string, outletSelector: string): HTMLElement;
    /**
     * Navigate to a route using SPA mode. Fetches and processes the .hott file
     * for the given path, then replaces only the SPA target element's content.
     * If SPA mode is not enabled (spaTarget is null), falls back to full page navigation.
     *
     * @param path The URL path to navigate to (e.g. "/proposals").
     * @param pushState If true, pushes the new URL to browser history. Set to false
     * for popstate handling where the URL is already correct.
     */
    static navigateTo(path: string, pushState?: boolean): Promise<void>;
    /**
     * Restore SPA data from window backup if class properties were reset.
     * This handles the case where useOutput's DOM replacement causes the
     * class static properties to be re-initialized.
     */
    static restoreSpaData(): void;
    /**
     * Enable SPA mode. Call this to set up link interception and popstate handling.
     *
     * @param target The CSS selector for the element whose content should be replaced
     * during SPA navigation (e.g. "main", "#content").
     * @param processor The HotStaq processor instance to use for processing pages.
     */
    static enableSPA(target: string, processor?: HotStaq): void;
    /**
     * Install fetch interceptors for SPA-mode frontends. Two pieces:
     *
     *   (a) Per-navigation `AbortController`. Every `window.fetch(...)`
     *       that doesn't already pass its own `signal` gets attached to
     *       `HotStaq.navAbort.signal`. On every SPA navigation the
     *       controller is aborted and replaced, so the previous page's
     *       in-flight requests die cleanly before the new page makes its
     *       own. Without this, rapid clicks accumulate abandoned fetches
     *       that occupy the browser's 6-per-origin connection cap and
     *       block subsequent page loads.
     *
     *   (b) Optional 401 hook. If `options.on401` is provided, any 401
     *       response from a non-skipped URL invokes the hook so the app
     *       can clear local credentials and surface "session expired"
     *       UX. The response is still returned to the original caller —
     *       the hook is purely additive.
     *
     * Idempotent: re-calling updates `skipUrls` / `on401` in place
     * without re-wrapping `window.fetch` or `onBeforeNavigate`. Called
     * automatically by `enableSPA` when
     * `HotStaq.autoInstallFetchInterceptors === true` (the default); set
     * that flag to `false` before the `<hotstaq>` element processes if
     * your app needs to manage fetch wrapping itself.
     *
     * @param options Skip-list and 401 hook. May be re-passed later to
     *                update either field.
     */
    static installFetchInterceptors(options?: IHotFetchInterceptorOptions): void;
    /**
     * Prefetch all .hott files from the routerManager in the background.
     * This preloads route content into the processor's file cache so that
     * subsequent SPA navigations skip the network fetch.
     */
    static prefetchRoutes(): void;
    /**
     * Wait for testers to load.
     *
     * @fixme This does not wait for ALL testers to finish loading. Only
     * the first one.
     */
    static waitForTesters(): Promise<void>;
    /**
     * Setup the testers api, if any.
     */
    static setupTesters(processor: HotStaq, options: HotStartOptions): void;
    /**
     * Setup the testers api on the client, if needed.
     */
    static setupClientTesters(processor: HotStaq): string;
    /**
     * When the window has finished loading, execute the function. This
     * is meant to start executing HotStaq.
     */
    static onInitalLoad(readyFunc: () => void): void;
    /**
     * Process and replace the current HTML page with the hott script from the given url.
     * This is meant for web browser use only.
     */
    static displayUrl(url: string | HotStartOptions, name?: string, processor?: HotStaq, args?: any): Promise<HotStaq>;
    /**
     * Process and replace the current HTML page with the hott script.
     * This is meant for web browser use only.
     */
    static displayContent(content: string | HotStartOptions, name?: string, processor?: HotStaq, args?: any): Promise<HotStaq>;
}
//# sourceMappingURL=HotStaq.d.ts.map