दस्तावेज़

एडिटर बनाएँ

declare function useEditor(options: EditorOptions): EditorInstance;

type EditorOptions = {
  extensions: Extension[];
  initialValue?: string;
  onChange?: (html: string) => void;
  onChangeJSON?: (json: DocumentJSON) => void;
  sanitize?: boolean;
  historyLimit?: number;
};

extensions आवश्यक है। initialValue शुरुआती HTML है और एक बार पढ़ा जाता है। historyLimit का डिफ़ॉल्ट 100 है। sanitize डिफ़ॉल्ट रूप से true है और HTML आउटपुट पर लागू होता है।

onChange HTML और onChangeJSON JSON देता है। हर फ़्रेम में अधिकतम एक रिपोर्ट आती है। { history: false } में समान HTML पर भी कॉलबैक चल सकता है।