UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

66 lines (65 loc) 2.01 kB
import React from 'react'; import type { LocaleProps } from 'jamis-core'; export declare function monacoFactory(containerElement: HTMLElement, monaco: any, options: Record<string, any>): any; export interface EditorProps extends LocaleProps { value?: string; defaultValue?: string; width?: number | string; height?: number | string; onChange?: (value: string, event: any) => void; language?: string; editorTheme?: string; allowFullscreen?: boolean; options: { [propName: string]: any; }; className?: string; context?: any; style?: React.CSSProperties; isDiffEditor?: boolean; placeholder?: string; onFocus?: () => void; onBlur?: () => void; editorDidMount?: (editor: any, monaco: any) => void; editorWillMount?: (monaco: any) => void; editorWillUnmount?: (editor: any, monaco: any) => void; editorFactory?: (conatainer: HTMLElement, monaco: any, options: any) => any; } export interface EditorState { isFullscreen?: boolean; innerWidth?: any; innerHeight?: any; } export declare class Editor extends React.Component<EditorProps, EditorState> { static defaultProps: { language: string; editorTheme: string; width: string; height: string; allowFullscreen: boolean; options: {}; }; state: { isFullscreen: boolean; innerWidth: string; innerHeight: string; }; editor: any; container: any; currentValue: any; preventTriggerChangeEvent: boolean; disposes: Array<{ dispose: () => void; }>; constructor(props: EditorProps); componentDidUpdate(prevProps: EditorProps): void; componentWillUnmount(): void; wrapperRef(ref: any): void; loadMonaco(): void; initMonaco(monaco: any): void; editorWillMount(monaco: any): void; editorDidMount(editor: any, monaco: any): void; handleFullscreenModeChange(): void; render(): JSX.Element; } export default Editor;