import { Node, Visitor, Token, ParseResult } from "@herb-tools/core"; import { PrintContext } from "./print-context.js"; import type { NotLocationless } from "@herb-tools/core"; /** * Options for controlling the printing behavior */ export type PrintOptions = { /** * When true, allows printing nodes that have parse errors. * When false (default), throws an error if attempting to print nodes with errors. * @default false */ ignoreErrors: boolean; }; /** * Default print options used when none are provided */ export declare const DEFAULT_PRINT_OPTIONS: PrintOptions; export declare abstract class Printer extends Visitor { protected context: PrintContext; /** * Static method to print a node without creating an instance * * @param input - The AST Node, Token, or ParseResult to print * @param options - Print options to control behavior * @returns The printed string representation of the input * @throws {Error} When node has parse errors and ignoreErrors is false */ static print(input: ((Token | Node | ParseResult | Node[]) & NotLocationless) | undefined | null, options?: PrintOptions): string; /** * Print a node, token, or parse result to a string * * @param input - The AST Node, Token, or ParseResult to print * @param options - Print options to control behavior * @returns The printed string representation of the input * @throws {Error} When node has parse errors and ignoreErrors is false */ print(input: ((Token | Node | ParseResult | Node[]) & NotLocationless) | undefined | null, options?: PrintOptions): string; protected write(content: string | null | undefined): void; }