import { StorageMode, Attribute } from './client.js';

interface ScriptConfig {
    storageMode: StorageMode;
    storageKey: string;
    cookieName: string;
    attribute: Attribute | Attribute[];
    themes: string[];
    defaultTheme: string;
    enableSystem: boolean;
    /**
     * Always use the system preference, ignoring any stored theme value.
     * When true, the script behaves as if `theme: 'system'` is selected on
     * every load, regardless of what is in the cookie / localStorage.
     * Mirrors the React provider's `followSystem` prop.
     */
    followSystem: boolean;
    forcedTheme: string | null;
    initialTheme: string | null;
    value: Record<string, string> | null;
    enableColorScheme: boolean;
    themeColor: string | Record<string, string> | null;
    /** CSS injected while the theme is applied, or `null` to leave transitions alone. */
    disableTransitionOnChange: string | null;
    respectReducedMotion: boolean;
    target: string;
}
interface BuildScriptOptions extends Partial<Omit<ScriptConfig, 'disableTransitionOnChange'>> {
    /** `true` for the built-in transition-disabling CSS, a string for custom CSS. */
    disableTransitionOnChange?: boolean | string | null;
}
/**
 * The attribute the constant {@link THEME_SCRIPT} reads its configuration from.
 */
declare const THEME_SCRIPT_ATTRIBUTE = "data-teispace-theme";
/**
 * Build the inline anti-FOUC script with its configuration baked into the
 * script text.
 *
 * Because the text varies with the configuration, a hash-based CSP needs a
 * separate hash per configuration. Prefer {@link THEME_SCRIPT} with
 * {@link getScriptConfig} (what the providers render): its text never changes,
 * so the single {@link THEME_SCRIPT_HASH} covers every app.
 */
declare function buildScript(opts: BuildScriptOptions): string;
/**
 * The configuration for {@link THEME_SCRIPT}, serialized for the
 * {@link THEME_SCRIPT_ATTRIBUTE} attribute. React escapes attribute values, so
 * no extra HTML escaping is needed here.
 */
declare function getScriptConfig(opts: BuildScriptOptions): string;
/**
 * The anti-FOUC script with a constant text: it reads its configuration from
 * the {@link THEME_SCRIPT_ATTRIBUTE} attribute of its own `<script>` element.
 *
 * Because the text never varies, one hash ({@link THEME_SCRIPT_HASH}) allows it
 * under a hash-based CSP for every configuration and every request — no nonce,
 * and so no forced dynamic rendering.
 */
declare const THEME_SCRIPT: string;
/**
 * The CSP source expression for {@link THEME_SCRIPT}, ready to drop into
 * `script-src`. A test recomputes it from the script text, so it cannot go
 * stale.
 */
declare const THEME_SCRIPT_HASH = "'sha256-0Z+segUWHZKpr3q+brt3vfTksotAe74NTii229eX9OA='";

export { THEME_SCRIPT, THEME_SCRIPT_ATTRIBUTE, THEME_SCRIPT_HASH, buildScript, getScriptConfig };
export type { BuildScriptOptions, ScriptConfig };
