react-simple-wysiwyg
Version:
Simple and lightweight React WYSIWYG editor
29 lines (28 loc) • 983 B
TypeScript
import { ComponentType, PureComponent, SyntheticEvent } from 'react';
import * as React from 'react';
import { ICEProps } from './ContentEditable';
import { IEditorStyles, IStyles } from './styles';
export declare const EditorContext: React.Context<IEditorContext>;
export default class Editor extends PureComponent<IEditorProps, IState> {
constructor(props: IEditorProps);
componentDidMount(): void;
componentWillUnmount(): void;
setContentEditableRef(el: HTMLElement): void;
onClickOutside(event: MouseEvent): void;
onTextSelect(e: SyntheticEvent<HTMLElement>): void;
render(): JSX.Element;
}
export declare function withEditorContext<T extends ComponentType<any>>(Component: T): T;
export interface IEditorProps extends ICEProps {
styles?: IEditorStyles;
}
export interface IEditorContext {
el?: HTMLElement;
selection?: Node;
styles?: IStyles;
}
interface IState {
contentEditable?: HTMLElement;
selection?: Node;
}
export {};