/** * Theme validation utilities for Script Kit. * Provides helpers to validate theme CSS and check for required variables. */ import type { ThemeValidationResult } from '../types/theme.js'; /** * Validate a theme CSS string for required variables. * Checks that all required CSS custom properties are present. * * @param css - Raw theme CSS string * @returns Validation result with missing variables and warnings * * @example * ```ts * const result = validateThemeCSS(themeCSS) * if (!result.valid) { * console.warn('Missing variables:', result.missing) * } * ``` */ export declare function validateThemeCSS(css: string): ThemeValidationResult; /** * Check if a theme CSS string is valid (has all required variables). * Convenience wrapper around validateThemeCSS. * * @param css - Raw theme CSS string * @returns True if the theme is valid * * @example * ```ts * if (isValidTheme(themeCSS)) { * applyTheme(themeCSS) * } * ``` */ export declare function isValidTheme(css: string): boolean; /** * Get a human-readable error message for invalid themes. * * @param result - Validation result from validateThemeCSS * @returns Error message describing the issues * * @example * ```ts * const result = validateThemeCSS(themeCSS) * if (!result.valid) { * console.error(getValidationErrorMessage(result)) * } * ``` */ export declare function getValidationErrorMessage(result: ThemeValidationResult): string; /** * Get a human-readable warning message for theme recommendations. * * @param result - Validation result from validateThemeCSS * @returns Warning message or empty string if no warnings * * @example * ```ts * const result = validateThemeCSS(themeCSS) * const warnings = getValidationWarningMessage(result) * if (warnings) { * console.warn(warnings) * } * ``` */ export declare function getValidationWarningMessage(result: ThemeValidationResult): string; /** * Validate and report theme issues to console. * Useful for development and debugging. * * @param css - Raw theme CSS string * @param themeName - Optional theme name for the log message * @returns True if the theme is valid * * @example * ```ts * // Will log warnings/errors to console * validateAndReport(themeCSS, 'my-custom-theme.css') * ``` */ export declare function validateAndReport(css: string, themeName?: string): boolean;