mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Grafana-UI: Type onEditorDidMount (#33178)
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
// We use `import type` to guarentee it'll be erased from the JS and it doesnt accidently bundle monaco
|
||||
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
|
||||
export type CodeEditorChangeHandler = (value: string) => void;
|
||||
export type CodeEditorSuggestionProvider = () => CodeEditorSuggestionItem[];
|
||||
|
||||
export type MonacoEditor = monaco.editor.IStandaloneCodeEditor;
|
||||
|
||||
export interface CodeEditorProps {
|
||||
value: string;
|
||||
language: string;
|
||||
@@ -17,9 +20,9 @@ export interface CodeEditorProps {
|
||||
/**
|
||||
* Callback after the editor has mounted that gives you raw access to monaco
|
||||
*
|
||||
* @alpha -- experimental - real type is: monaco.editor.IStandaloneCodeEditor
|
||||
* @alpha -- experimental
|
||||
*/
|
||||
onEditorDidMount?: (editor: any) => void;
|
||||
onEditorDidMount?: (editor: monaco.editor.IStandaloneCodeEditor) => void;
|
||||
|
||||
/** Handler to be performed when editor is blurred */
|
||||
onBlur?: CodeEditorChangeHandler;
|
||||
|
||||
@@ -38,7 +38,7 @@ export { QueryField } from './QueryField/QueryField';
|
||||
|
||||
// Code editor
|
||||
export { CodeEditor } from './Monaco/CodeEditorLazy';
|
||||
export { CodeEditorSuggestionItem, CodeEditorSuggestionItemKind } from './Monaco/types';
|
||||
export { MonacoEditor, CodeEditorSuggestionItem, CodeEditorSuggestionItemKind } from './Monaco/types';
|
||||
export { variableSuggestionToCodeEditorSuggestion } from './Monaco/utils';
|
||||
|
||||
// TODO: namespace
|
||||
|
||||
Reference in New Issue
Block a user