@nteract/monaco-editor
Version:
A React component for the monaco editor, tailored for nteract
13 lines (12 loc) • 703 B
TypeScript
import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
export interface IEditor {
layout(dimension: monaco.editor.IDimension): void;
shouldLayout(): boolean;
getLayoutDimension: () => monaco.editor.IDimension | undefined;
}
/**
* For monaco editors, we need to call layout() on any editors that might have changed size otherwise the view will look off.
* These updates often happen together with other editors, such as when the window resizes.
* In order to avoid layout thrashing, we batch these layout calls together and perform them all at once in a RAF timeout.
*/
export declare function scheduleEditorForLayout(editor: IEditor, layout?: monaco.editor.IDimension): void;