import type { AppHeadConfig } from './types/config-types';
/**
 * Insert the inline x-cloak <style> before </head> if a head exists and the
 * style isn't already present. Idempotent (guards on the data-stx-cloak
 * marker). No-op when the output has no </head> — those paths fall back to
 * the runtime's late injection.
 */
export declare function injectCloakStyle(html: string): string;
/**
 * Generate the full HTML document shell wrapping page content.
 *
 * @param content - The rendered page/layout HTML (no document wrapper)
 * @param headConfig - Head configuration from stx.config.ts
 * @param options - Additional options for script/style injection
 * @returns Complete HTML document
 */
export declare function generateDocumentShell(content: string, headConfig?: AppHeadConfig, options?: {
    /** Page-specific title (overrides config) */
    title?: string
    /** Extra styles to inject in <head> (e.g. Crosswind CSS, scoped styles) */
    styles?: string[]
    /** Extra scripts to inject before </body> (e.g. signals runtime, router) */
    bodyScripts?: string[]
    /** Extra scripts/tags for <head> */
    headScripts?: string[]
    /** Stacks to inject (from @push directives) */
    headStack?: string
    bodyStack?: string
  }): string;
/**
 * Check if HTML already has a document shell (<!DOCTYPE> or <html>).
 * Templates that extend layouts with document shells should not be
 * double-wrapped — the visible artifact of a double-wrap is the user's
 * `<title>` getting nested under the auto-shell's default `stx App`,
 * which then wins for `document.title` because it appears first.
 *
 * The check is permissive on placement: if the rendered output contains
 * a `<!DOCTYPE>` or `<html>` ANYWHERE, the user has supplied a shell.
 * Earlier this only checked the leading bytes after stripping comments,
 * but other directives (signals runtime, scoped scripts, theme guards)
 * happily prepend their own `<script>` tags before any layout markup,
 * which made the check spuriously fail and auto-shell wrap the user's
 * complete HTML doc as if it were just body content.
 */
export declare function hasDocumentShell(html: string): boolean;
/**
 * Wrap HTML in a document shell if it doesn't already have one.
 * This is the main entry point — called at the top level after all
 * directive processing is complete.
 */
export declare function ensureDocumentShell(html: string, headConfig?: AppHeadConfig, options?: Parameters<typeof generateDocumentShell>[2]): string;
/**
 * Inline x-cloak rule shipped in the SSR <head> (stacksjs/stx#1736).
 *
 * Must be parsed by the browser BEFORE first paint — so it goes in the head
 * as static markup, not injected by the runtime script (which runs after the
 * body has already painted, the window where false `:if` branches / hidden
 * `:show` elements flash). The `data-stx-cloak` marker makes injection
 * idempotent. The runtime's own late injection (signals.ts) is retained as a
 * belt-and-suspenders for SPA-nav fragments that arrive without SSR head
 * emission.
 */
export declare const CLOAK_STYLE: '<style data-stx-cloak>[x-cloak]{display:none !important}</style>';
