/**
 * Register a custom filter
 *
 * @param name - Filter name (used in templates as {{ value | filterName }})
 * @param fn - Filter function
 *
 * @example
 * ```typescript
 * // Register a custom filter
 * registerFilter('reverse', (value) => {
 *   return String(value).split('').reverse().join('')
 * })
 *
 * // Use in template: {{ name | reverse }}
 * ```
 */
export declare function registerFilter(name: string, fn: FilterFunction): void;
/**
 * Register multiple custom filters at once
 *
 * @param filters - Object mapping filter names to functions
 *
 * @example
 * ```typescript
 * registerFilters({
 *   reverse: (value) => String(value).split('').reverse().join(''),
 *   double: (value) => Number(value) * 2,
 * })
 * ```
 */
export declare function registerFilters(filters: Record<string, FilterFunction>): void;
/**
 * Get all available filters (built-in + custom)
 */
export declare function getAllFilters(): Record<string, FilterFunction>;
/**
 * Clear all custom filters (useful for testing)
 */
export declare function clearCustomFilters(): void;
/**
 * HTML escape function to prevent XSS
 */
export declare function escapeHtml(unsafe: string): string;
/**
 * Check if a template uses signals (state, derived, effect) in its script blocks
 * or has reactive attributes (@if, @for) with function call expressions
 */
export declare function usesSignalsInScript(template: string): boolean;
/**
 * Interpolate server-side `{{ expr }}` / `{!! expr !!}` expressions inside a
 * `<script>` body, using the same evaluator as the main template.
 *
 * This makes server data available to client scripts without manual data-island
 * plumbing — write `const PRICE = {{ car.price }}` and get `const PRICE = 42`.
 *
 * JavaScript-aware rules (different from HTML `{{ }}`):
 *   - `{{ expr }}` → `JSON.stringify(value)`. Strings become valid JS string
 *     literals, numbers/booleans pass through, objects/arrays become JSON
 *     literals. Safe to drop into any JS expression position.
 *   - `{!! expr !!}` → raw `String(value)`. Use when you want the value spliced
 *     verbatim (e.g. you've already serialized it yourself).
 *   - Expressions that fail to evaluate (reference a client-only signal, a
 *     loop variable, or anything not in context) are left **untouched** so the
 *     client runtime can process them later. This mirrors the "preserve for
 *     client" semantics of the main expression processor when signals are in use.
 *
 * Only the content strictly between `<script>` and `</script>` is touched —
 * attributes and surrounding HTML are left alone.
 */
export declare function interpolateScriptExpressions(scriptBody: string, context: Record<string, any>): string;
/**
 * Interpolate server expressions inside every `<script>` tag in a template,
 * skipping any script that opts out via `data-raw`, `type="application/json"`,
 * or a `src=` attribute (external scripts don't have inline content to template).
 *
 * Each matched script has its body passed through {@link interpolateScriptExpressions}.
 * Attributes and tag structure are never modified.
 */
export declare function interpolateScriptsInTemplate(template: string, context: Record<string, any>, options?: InterpolateScriptsOptions): string;
/**
 * Process template expressions including variables, filters, and operations
 */
export declare function processExpressions(template: string, context: Record<string, any>, filePath: string): string;
/**
 * Apply filters to a value
 */
export declare function applyFilters(value: any, filterExpression: string, context: Record<string, any>): any;
/**
 * Evaluate an expression within the given context
 * @param {string} expression - The expression to evaluate
 * @param {Record<string, any>} context - The context object containing variables
 * @param {boolean} silent - Whether to silently handle errors (return undefined) or throw
 * @returns The evaluated result
 */
export declare function evaluateExpression(expression: string, context: Record<string, any>, silent?: boolean): any;
/**
 * HTML unescape function to reverse escapeHtml
 */
export declare function unescapeHtml(html: string): string;
// =============================================================================
// Built-in Filters
// =============================================================================
export declare const defaultFilters: {
  uppercase: (value: any, _context: Record<string, any>) => unknown;
  lowercase: (value: any, _context: Record<string, any>) => unknown;
  capitalize: (value: any, _context: Record<string, any>) => unknown;
  number: (value: any, _context: Record<string, any>, decimals?: number) => unknown;
  fmt: (value: any, _context: Record<string, any>, locale?: string) => unknown;
  join: (value: any, _context: Record<string, any>, separator?: string) => unknown;
  escape: (value: any, _context: Record<string, any>) => unknown;
  translate: (value: any, context: Record<string, any>, params?: Record<string, any>) => unknown;
  t: (value: any, context: Record<string, any>, params?: Record<string, any>) => unknown;
  truncate: (value: any, _context: Record<string, any>, length?: number, suffix?: string) => unknown;
  date: (value: any, _context: Record<string, any>, format?: string, locale?: string) => unknown;
  currency: (value: any, _context: Record<string, any>, currencyCode?: string, locale?: string) => unknown;
  pluralize: (value: any, _context: Record<string, any>, singular: string, plural?: string) => unknown;
  first: (value: any, _context: Record<string, any>) => unknown;
  last: (value: any, _context: Record<string, any>) => unknown;
  length: (value: any, _context: Record<string, any>) => unknown;
  json: (value: any, _context: Record<string, any>, pretty?: boolean) => unknown;
  default: (value: any, _context: Record<string, any>, defaultValue?: any) => unknown;
  reverse: (value: any, _context: Record<string, any>) => unknown;
  slice: (value: any, _context: Record<string, any>, start?: number, end?: number) => unknown;
  replace: (value: any, _context: Record<string, any>, search: string, replacement?: string) => unknown;
  stripTags: (value: any, _context: Record<string, any>) => unknown;
  urlencode: (value: any, _context: Record<string, any>) => unknown;
  abs: (value: any, _context: Record<string, any>) => unknown;
  round: (value: any, _context: Record<string, any>, decimals?: number) => unknown
};
/**
 * Options for {@link interpolateScriptsInTemplate}.
 */
export declare interface InterpolateScriptsOptions {
  skipServer?: boolean
}
/**
 * Add basic filter support to expressions
 * Filter functions receive the value to transform, optional args, and the context object
 */
// eslint-disable-next-line pickier/no-unused-vars
export type FilterFunction = (value: any, context: Record<string, any>, ...args: any[]) => any;
