Skip to content

Commit 1216506

Browse files
committed
Fix monaco editor type import
1 parent 1fee202 commit 1216506

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/QueryEditor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { CoreApp, FeatureState, QueryEditorProps, SelectableValue } from '@grafa
1818
import { DataSource } from '../datasource';
1919
import { MongoDataSourceOptions, MongoQuery, QueryLanguage, QueryType, DEFAULT_QUERY } from '../types';
2020
import { parseJsQuery, parseJsQueryLegacy, validateJsonQueryText, validatePositiveNumber } from '../utils';
21-
import * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';
21+
import { editor } from 'monaco-editor';
2222
import './QueryEditor.css';
2323

2424
type Props = QueryEditorProps<DataSource, MongoQuery, MongoDataSourceOptions>;
@@ -43,7 +43,7 @@ const languageOptions: Array<SelectableValue<string>> = [
4343
];
4444

4545
export function QueryEditor({ query, onChange, app }: Props) {
46-
const codeEditorRef = useRef<monacoType.editor.IStandaloneCodeEditor | null>(null);
46+
const codeEditorRef = useRef<editor.IStandaloneCodeEditor | null>(null);
4747
const [queryTextError, setQueryTextError] = useState<string | null>(null);
4848
const [isOpen, setIsOpen] = useState(false);
4949

@@ -129,7 +129,7 @@ export function QueryEditor({ query, onChange, app }: Props) {
129129
onChange({ ...query, aggregateComment: event.target.value });
130130
};
131131

132-
const onCodeEditorDidMount = (e: monacoType.editor.IStandaloneCodeEditor) => {
132+
const onCodeEditorDidMount = (e: editor.IStandaloneCodeEditor) => {
133133
codeEditorRef.current = e;
134134
};
135135

0 commit comments

Comments
 (0)