Currently, Lexical does not export DOMExportOutputMap as a standalone type.
Developers creating custom export configurations in the html property for CreateEditorArgs have to define DOMExportOutputMap manually, which is error-prone and inconsistent.
Currently, when developers need to customize the html export configuration, they must re-create the structure for DOMExportOutputMap, which leads to redundant code and increases the risk of type errors due to misconfiguration. This is especially relevant when dealing with complex export setups where nodes have specific styles or properties that need to be customized for DOM output.
The expected behavior
DOMExportOutputMap should be exported directly from the Lexical core library, allowing developers to import and use this type immediately in any export configuration of the html property. This would improve type safety, reduce code duplication, and streamline custom DOM export setups.
Impact of fix
Low-to-Moderate, as this mainly affects type handling and reusability rather than functionality.
Developers like me working with custom DOM export configurations in Lexical editors, especially in applications that need highly customized export logic, will greatly benefit from it. Had to create a custom type instead of just using the DOM
Improved development efficiency and reduced risk of type-related errors for all users implementing html.export in CreateEditorArgs.
Lexical version: V0.19.0
Steps To Reproduce
DOMExportOutputMap
as a standalone type.html
property forCreateEditorArgs
have to defineDOMExportOutputMap
manually, which is error-prone and inconsistent.Link to code example: https://github.com/facebook/lexical/blob/a4e70168a13271dfdaa8e2684f5fc99658f3236c/examples/react-rich/src/App.tsx#L56
The current behavior
Currently, when developers need to customize the html export configuration, they must re-create the structure for
DOMExportOutputMap
, which leads to redundant code and increases the risk of type errors due to misconfiguration. This is especially relevant when dealing with complex export setups where nodes have specific styles or properties that need to be customized for DOM output.The expected behavior
DOMExportOutputMap
should be exported directly from the Lexical core library, allowing developers to import and use this type immediately in any export configuration of thehtml
property. This would improve type safety, reduce code duplication, and streamline custom DOM export setups.Impact of fix