import type { ElementalContent, ElementalTextContentNode, TextStyle } from "@/types/elemental.types"; /** * FNV-1a hash — fast, non-crypto, good distribution for short strings. * Returns a compact base-36 string. */ export declare function fnv1aHash(str: string): string; export interface TranslatableField { /** Stable path-based identifier, e.g. "email.0.content" or "email.raw.subject" */ id: string; /** Channel this field belongs to (e.g. "email", "sms", "push") */ channel: string; /** Elemental node type: "text", "action", "quote", "meta" */ nodeType: string; /** Text style hint for text nodes (h1, h2, h3, text, subtext) */ textStyle?: TextStyle; /** The default/source locale text content */ content: string; /** Raw Elemental inline elements for rich text nodes (preserves formatting) */ elements?: ElementalTextContentNode[]; /** Existing locale translations keyed by locale code */ locales: Record; /** Existing locale translations with rich elements, keyed by locale code */ localeElements?: Record; /** Locale codes whose translation was made against a different source text */ staleLocales?: Set; } /** * Extract all translatable text fields from an ElementalContent tree. * * Walks each channel's element subtree and collects text from: * - text nodes (paragraphs, headings) * - action nodes (button labels) * - quote nodes * - meta nodes (titles / email subjects) * - channel raw fields (subject, title, text) * * Skips image alt_text, html content, dividers, and comments. */ export declare function extractTextFields(content: ElementalContent | null | undefined): TranslatableField[]; /** * Collect all unique locale codes found across every translatable field in the content. * Returns a sorted array of locale codes, e.g. ["de", "fr", "ja"]. */ export declare function extractExistingLocales(content: ElementalContent | null | undefined): string[]; /** * Update a locale translation on a specific field in the Elemental content tree. * Returns a new content object (immutable update). * * - Empty `value` removes the locale entry for that field. * - Non-empty `value` adds or replaces the locale entry. */ export declare function updateLocaleTranslation(content: ElementalContent, fieldId: string, localeCode: string, value: string): ElementalContent; /** * Update a locale translation with rich elements on a specific field. * Like `updateLocaleTranslation`, but stores `elements` (not `content`) * on the locale entry — preserving inline formatting through AI translation. * * Only applicable to text nodes (not raw/meta/action/quote). */ export declare function updateLocaleTranslationWithElements(content: ElementalContent, fieldId: string, localeCode: string, elements: ElementalTextContentNode[]): ElementalContent;