import { IdentityPrinter } from "./identity-printer.js"; import { PrintOptions } from "./printer.js"; import { ERBContentNode } from "@herb-tools/core"; import { HTMLTextNode, ERBIfNode, ERBUnlessNode, ERBCommentNode, Node, HTMLAttributeValueNode } from "@herb-tools/core"; export interface ERBToRubyStringOptions extends PrintOptions { /** * Whether to force wrapping the output in double quotes even for single ERB nodes * @default false */ forceQuotes?: boolean; } export declare const DEFAULT_ERB_TO_RUBY_STRING_OPTIONS: ERBToRubyStringOptions; /** * ERBToRubyStringPrinter - Converts ERB snippets to Ruby strings with interpolation * * This printer transforms ERB templates into Ruby strings by: * - Converting literal text to string content * - Converting <%= %> tags to #{} interpolation * - Converting simple if/else blocks to ternary operators * - Ignoring <% %> tags (they don't produce output) * * Examples: * - `hello world <%= hello %>` => `"hello world #{hello}"` * - `hello world <% hello %>` => `"hello world "` * - `Welcome <%= user.name %>!` => `"Welcome #{user.name}!"` * - `<% if logged_in? %>Welcome<% else %>Login<% end %>` => `"logged_in? ? "Welcome" : "Login"` * - `<% if logged_in? %>Welcome<% else %>Login<% end %>!` => `"#{logged_in? ? "Welcome" : "Login"}!"` */ export declare class ERBToRubyStringPrinter extends IdentityPrinter { static print(node: Node, options?: Partial): string; visitHTMLTextNode(node: HTMLTextNode): void; visitERBCommentNode(_node: ERBCommentNode): void; visitERBContentNode(node: ERBContentNode): void; visitERBIfNode(node: ERBIfNode): void; visitERBUnlessNode(node: ERBUnlessNode): void; visitHTMLAttributeValueNode(node: HTMLAttributeValueNode): void; private canConvertToTernary; private convertToTernary; private convertToTernaryWithoutWrapper; private canConvertUnlessToTernary; private convertUnlessToTernary; private convertUnlessToTernaryWithoutWrapper; }