import "../../../editor-kernel/index.js"; import { IServiceID } from "../../../types/kernel.js"; import DataSource, { IWriteOptions } from "../../../editor-kernel/data-source.js"; import "../../../types/index.js"; import { ILitexmlService } from "../service/litexml-service.js"; import { LexicalEditor } from "lexical"; /** * LitexmlDataSource - Handles conversion between Lexical editor state and XML format * Provides read (parse XML to Lexical) and write (export Lexical to XML) capabilities */ declare class LitexmlDataSource extends DataSource { protected dataType: string; protected getService?: ((serviceId: IServiceID) => T | null) | undefined; private litexmlService; private ctx; constructor(dataType?: string, getService?: ((serviceId: IServiceID) => T | null) | undefined, service?: ILitexmlService); readLiteXMLToInode(litexml: string): any; /** * Parse XML string and set it to the editor * @param editor - The Lexical editor instance * @param data - XML string to parse */ read(editor: LexicalEditor, data: string): void; /** * Export editor content to XML format * @param editor - The Lexical editor instance * @param options - Write options (e.g., selection flag) * @returns XML string representation of the editor content */ write(editor: LexicalEditor, options?: IWriteOptions): any; /** * Parse XML string using browser's built-in parser */ private parseXMLString; /** * Convert XML document to Lexical node structure */ private xmlToLexical; /** * Recursively process XML elements and convert to Lexical nodes */ private processXMLElement; /** * Process XML element's children */ private processXMLChildren; /** * Convert Lexical node structure to XML string */ private lexicalToXML; /** * Recursively convert Lexical nodes to XML elements */ private nodesToXML; /** * Build XML attribute string from attributes object */ private buildXMLAttributes; /** * Escape XML special characters */ private escapeXML; } export { LitexmlDataSource as default };