UNPKG

simple-react-ui

Version:

a simple react component library written in TypeScript+ React.js

71 lines (70 loc) 1.78 kB
/// <reference types="react" /> import * as React from 'react'; export interface UEditorProps { /** * 唯一标识符 */ id: string; /** * 编辑器高度 */ height: number; /** * 编辑器宽度 */ width: number; /** * 脚本 uconfig.js 的src */ uconfigSrc: string; /** * 脚本 ueditor.js 的src */ ueditorSrc: string; /** * 表示在非受控模式下,为编辑器设置初始值。 * 不能和 value 同时起用! */ initialContent?: string; /** * 如果提供该属性,则表示是在受控模式下使用,由父组件设置 */ value?: string; /** * ContentChange的 节流时间间隔 */ contentChangeThrottleTime: number; /** * 类似于原生React的ref回调 */ afterInit?: (ue: any) => void; /** * 当编辑器内容变化之后会自动触发的钩子函数。 * 可选。 */ onChange?: (content) => void; } /** * 百度UEditor的React封装 */ export declare class UEditor extends React.Component<UEditorProps, any> { constructor(props: UEditorProps); static defaultProps: UEditorProps; _getUEditorAsync(): any; _getUEditorSync(): any; _onContentChange(type: any): void; _initUEditor(): Promise<any>; _timeoutPromise(timeout: any): Promise<{}>; _waitUntilUEditorloaded(): any; _createScript(): void; /** * * @param nextProps */ componentWillReceiveProps(nextProps: UEditorProps): any; componentWillMount(): void; componentDidMount(): any; componentWillUnmount(): void; render(): JSX.Element; } export default UEditor;