Export full monaco-editor types for typescript
I'm using react-monaco-editor in a React + typescript project
For some implementations I want to give appropriate types of monaco-editor as described in the docs https://microsoft.github.io/monaco-editor/api/index.html But didn't found these types in react-monaco-editor exports
For ex: here in editorDidMount I don't want the any type
const editorDidMount = (editor: any, monaco: any): void => {
//do something
};
//...
<MonacoEditor
language={language}
value={code}
editorDidMount={editorDidMount}
/>
So in order to give the editor its right type I had to add monaco-editor to the package-json and then import from it
//...
import MonacoEditor from 'react-monaco-editor';
import { editor } from 'monaco-editor';
//...
const editorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: any): void => {
//do something
};
Suggested solution
Enable to import all the types directly from react-monaco-editor without having to import monaco-ediitor and import the types from there
Happy to review a pull request with the changes and docs.
@domoritz This is the PR: #315, I'd happy for review thanks!