UNPKG

oiocns-editer

Version:

About oiocns of a component package.

21 lines (20 loc) 777 B
import { editor } from 'monaco-editor/esm/vs/editor/editor.api'; import { CSSProperties, RefObject } from 'react'; import './index.css'; import React from 'react'; export type EditorLanguages = 'javascript' | 'typescript' | 'css' | 'json' | 'html' | 'markdown' | 'vue' | 'java' | 'tsx' | 'jsx'; export interface MonacoEditorProps { value?: string; onChange?: (v: string) => void; language: EditorLanguages; readonly?: boolean; editor?: RefObject<editor.IStandaloneCodeEditor>; /** * TypeScript类型定义文件,针对language='javascript' | 'typescript' 生效 */ definitions?: { [filePath: string]: string; }; style?: CSSProperties; } export declare const MonacoEditor: (props: MonacoEditorProps) => React.JSX.Element;