//#region src/utils/jsx-editable-transpiler.d.ts /** * Metadata for an editable text region in JSX source code. * This information is used by the AI to accurately locate and update text. */ type EditableMetadata = { /** Unique identifier for this editable region */id: string; /** Exact source code location */ loc: { start: number; end: number; line: number; column: number; }; /** The original text content */ originalText: string; /** Hash of original text for quick mismatch detection */ textHash: string; /** JSX ancestry path from component root to this text node */ jsxPath: string[]; /** The immediate parent JSX element */ parentElement: { tagName: string; props: Record; }; /** Surrounding source context for disambiguation */ sourceContext: { before: string; after: string; }; /** Index among sibling text nodes in the same parent */ siblingIndex: number; /** Total count of this exact text in the source */ occurrenceCount: number; /** Which occurrence this is (1-indexed) */ occurrenceIndex: number; /** Which file this text is in */ sourceFile: "template" | "theme"; }; /** * Result of transpiling JSX source to include editable markers. */ type TranspileResult = { /** The transformed source code with __Editable wrappers */code: string; /** Map of editable region IDs to their metadata */ editableRegions: Record; }; /** * Transpiles TSX source code to wrap all static JSX text nodes with __Editable components. * * For example: * ```tsx * Hi, {name}! Welcome. * ``` * becomes: * ```tsx * * <__Editable __id="e1">Hi, * {name} * <__Editable __id="e2">! Welcome. * * ``` */ declare function transpileJsxForEditing(source: string, options: { sourceFile: "template" | "theme"; }): TranspileResult; /** * Post-processes rendered HTML to convert sentinel tokens to HTML comments. * * Converts: * - `⟦STACK_EDITABLE_START:⟧` → `` * - `⟦STACK_EDITABLE_END:⟧` → `` * - `⟦STACK_EXPR_START:⟧` → `` * - `⟦STACK_EXPR_END⟧` → `` */ declare function convertSentinelTokensToComments(html: string): string; //#endregion export { EditableMetadata, TranspileResult, convertSentinelTokensToComments, transpileJsxForEditing }; //# sourceMappingURL=jsx-editable-transpiler.d.ts.map