carbon-react
Version:
A library of reusable React components for easily building user interfaces.
24 lines (23 loc) • 970 B
TypeScript
import { LexicalEditor } from "lexical";
/**
* This helper takes the current state of the editor and serializes it into two formats:
* 1. HTML
* 2. JSON
* This allows the editor state to be saved and restored at a later time, in a format suitable
* for the majority of customers' use cases.
*/
declare const SerializeLexical: (editor: LexicalEditor) => {
htmlString: undefined;
json: undefined;
};
/**
* This helper takes an HTML string and deserializes it into the editor.
* This allows the editor to be restored from a previously saved state.
*/
declare const DeserializeHTML: (html: string) => string;
/** Function to validate a given URL */
declare function validateUrl(url: string): boolean;
declare const createFromHTML: (html: string) => string;
/** Creates and returns a string representation of an empty editor */
declare const createEmpty: () => string;
export { createEmpty, createFromHTML, DeserializeHTML, SerializeLexical, validateUrl, };