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