Skip to content

Commit

Permalink
Use IStandaloneEditorConstructionOptions for EditorWillMount (#265)
Browse files Browse the repository at this point in the history
Fixes #264.
  • Loading branch information
JoshuaKGoldberg committed Feb 7, 2020
1 parent 7455a02 commit f9d9e3a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ export type EditorDidMount = (
monaco: typeof monacoEditor
) => void;

export type EditorWillMount = (monaco: typeof monacoEditor) => void | monacoEditor.editor.IEditorConstructionOptions;

/**
* @remarks
* This will be `IStandaloneEditorConstructionOptions` in newer versions of monaco-editor, or
* `IEditorConstructionOptions` in versions before that was introduced.
*/
export type EditorConstructionOptions = NonNullable<Parameters<typeof monacoEditor.editor.create>[1]>;

export type EditorWillMount = (monaco: typeof monacoEditor) => void | EditorConstructionOptions;

declare interface MonacoEditorBaseProps {
/**
* Width of editor. Defaults to 100%.
Expand Down

0 comments on commit f9d9e3a

Please sign in to comment.