1 | import * as React from 'react';
|
2 | import { IEvents } from '../Events';
|
3 | import { ScriptItem } from '../ScriptLoader2';
|
4 | import { IEditorPropTypes } from './EditorPropTypes';
|
5 | import { Editor as TinyMCEEditor, TinyMCE } from 'tinymce';
|
6 | type EditorOptions = Parameters<TinyMCE['init']>[0];
|
7 | export interface IProps {
|
8 | apiKey: string;
|
9 | id: string;
|
10 | inline: boolean;
|
11 | initialValue: string;
|
12 | onEditorChange: (a: string, editor: TinyMCEEditor) => void;
|
13 | value: string;
|
14 | init: EditorOptions & {
|
15 | selector?: undefined;
|
16 | target?: undefined;
|
17 | };
|
18 | tagName: string;
|
19 | cloudChannel: string;
|
20 | plugins: NonNullable<EditorOptions['plugins']>;
|
21 | toolbar: NonNullable<EditorOptions['toolbar']>;
|
22 | disabled: boolean;
|
23 | textareaName: string;
|
24 | tinymceScriptSrc: string | string[] | ScriptItem[];
|
25 | rollback: number | false;
|
26 | scriptLoading: {
|
27 | async?: boolean;
|
28 | defer?: boolean;
|
29 | delay?: number;
|
30 | };
|
31 | }
|
32 | export interface IAllProps extends Partial<IProps>, Partial<IEvents> {
|
33 | }
|
34 | export declare class Editor extends React.Component<IAllProps> {
|
35 | static propTypes: IEditorPropTypes;
|
36 | static defaultProps: Partial<IAllProps>;
|
37 | editor?: TinyMCEEditor;
|
38 | private id;
|
39 | private elementRef;
|
40 | private inline;
|
41 | private currentContent?;
|
42 | private boundHandlers;
|
43 | private rollbackTimer;
|
44 | private valueCursor;
|
45 | constructor(props: Partial<IAllProps>);
|
46 | private get view();
|
47 | componentDidUpdate(prevProps: Partial<IAllProps>): void;
|
48 | componentDidMount(): void;
|
49 | componentWillUnmount(): void;
|
50 | render(): React.ReactElement<{
|
51 | ref: React.RefObject<HTMLElement>;
|
52 | id: string;
|
53 | }, string | React.JSXElementConstructor<any>>;
|
54 | private changeEvents;
|
55 | private beforeInputEvent;
|
56 | private renderInline;
|
57 | private renderIframe;
|
58 | private getScriptSources;
|
59 | private getInitialValue;
|
60 | private bindHandlers;
|
61 | private rollbackChange;
|
62 | private handleBeforeInput;
|
63 | private handleBeforeInputSpecial;
|
64 | private handleEditorChange;
|
65 | private handleEditorChangeSpecial;
|
66 | private initialise;
|
67 | }
|
68 | export {};
|