@@ -26,34 +26,114 @@ export type InitOptions = Omit<OmitStringIndexSignature<EditorOptions>, OmittedI
2626export type Version = `${'4' | '5' | '6' | '7' } ${'' | '-dev' | '-testing' | `.${number } ` | `.${number } .${number } `} `;
2727
2828export interface IProps {
29+ /**
30+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#apikey React Tech Ref - apiKey }
31+ * @description TinyMCE API key for deployments using Tiny Cloud.
32+ */
2933 apiKey : string ;
34+ /**
35+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#id React Tech Ref - id }
36+ * @description The ID of the element to render the editor into.
37+ */
3038 id : string ;
39+ /**
40+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#inline React Tech Ref - inline }
41+ * @description Whether the editor should be rendered inline. Equivalent to the `inline` option in TinyMCE.
42+ */
3143 inline : boolean ;
44+ /**
45+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#initialvalue React Tech Ref - initialValue }
46+ * @description The initial HTML content of the editor.
47+ *
48+ * IMPORTANT: Ensure that this is **not** updated by `onEditorChange` or the editor will be unusable.
49+ */
3250 initialValue : string ;
51+ /**
52+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#oneditorchange React Tech Ref - onEditorChange }
53+ * @description Used to store the state of the editor outside the component. Typically used for controlled components.
54+ * @param a The current HTML content of the editor.
55+ * @param editor The TinyMCE editor instance.
56+ * @returns void
57+ */
3358 onEditorChange : ( a : string , editor : TinyMCEEditor ) => void ;
59+ /**
60+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#value React Tech Ref - value }
61+ * @description The current HTML content of the editor. Typically used for controlled components.
62+ */
3463 value : string ;
64+ /**
65+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#init React Tech Ref - init }
66+ * @description Additional settings passed to `tinymce.init()` when initializing the editor.
67+ */
3568 init : InitOptions ;
69+ /**
70+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tagname React Tech Ref - tagName }
71+ * @description The tag name of the element to render the editor into. Only valid when `inline` is `true`.
72+ */
3673 tagName : string ;
74+ /**
75+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tabIndex React Tech Ref - tabIndex }
76+ * @description The tab index of the element that the editor wraps.
77+ */
3778 tabIndex : number ;
79+ /**
80+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#cloudchannel React Tech Ref - cloudChannel }
81+ * @description The TinyMCE build to use when loading from Tiny Cloud.
82+ */
3883 cloudChannel : Version ;
84+ /**
85+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#plugins React Tech Ref - plugins }
86+ * @description The plugins to load into the editor. Equivalent to the `plugins` option in TinyMCE.
87+ */
3988 plugins : NonNullable < EditorOptions [ 'plugins' ] > ;
89+ /**
90+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#toolbar React Tech Ref - toolbar }
91+ * @description The toolbar to load into the editor. Equivalent to the `toolbar` option in TinyMCE.
92+ */
4093 toolbar : NonNullable < EditorOptions [ 'toolbar' ] > ;
94+ /**
95+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#disabled React Tech Ref - disabled }
96+ * @description Whether the editor should be "disabled" (read-only).
97+ */
4198 disabled : boolean ;
99+ /**
100+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#textareaname React Tech Ref - textareaName }
101+ * @description Set the `name` attribute of the `textarea` element used for the editor in forms. Only valid in iframe mode.
102+ */
42103 textareaName : string ;
104+ /**
105+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tinymcescriptsrc React Tech Ref - tinymceScriptSrc }
106+ * @description The URL of the TinyMCE script to lazy load.
107+ */
43108 tinymceScriptSrc : string | string [ ] | ScriptItem [ ] ;
109+ /**
110+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#rollback React Tech Ref - rollback }
111+ * @description The number of milliseconds to wait before reverting to the previous value when the editor's content changes.
112+ */
44113 rollback : number | false ;
114+ /**
115+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#scriptloading React Tech Ref - scriptLoading }
116+ * @description Options for how the TinyMCE script should be loaded.
117+ * @property async Whether the script should be loaded with the `async` attribute.
118+ * @property defer Whether the script should be loaded with the `defer` attribute.
119+ * @property delay The number of milliseconds to wait before loading the script.
120+ */
45121 scriptLoading : {
46122 async ?: boolean ;
47123 defer ?: boolean ;
48124 delay ?: number ;
49125 } ;
126+ /**
127+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#licenseKey React Tech Ref - licenseKey }
128+ * @description Tiny Cloud License Key for when self-hosting TinyMCE.
129+ */
50130 licenseKey : string ;
51131}
52132
53133export interface IAllProps extends Partial < IProps > , Partial < IEvents > { }
54134
55135/**
56- * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/ } for the TinyMCE React Technical Reference
136+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/ TinyMCE React Technical Reference }
57137 */
58138export class Editor extends React . Component < IAllProps > {
59139 public static propTypes : IEditorPropTypes = EditorPropTypes ;
0 commit comments