import { EditorView } from '@codemirror/view' ; import { Diagnostic , linter } from '@codemirror/lint' ; import { HybridLint } from './hybrid' ; import { Extension } from '@codemirror/state' ; type lintFunc = ( view : EditorView ) => readonly Diagnostic [ ] | Promise < readonly Diagnostic [ ] > ; export interface LintStrategy { promQL ( this ) : lintFunc ; } export function newLintStrategy ( ) { return new HybridLint ( ) ; } export function promQLLinter ( callbackFunc , thisArg ) { return linter ( callbackFunc . call ( thisArg ) ) ; }