import type monaco from 'monaco-editor'; /** A single label matcher from the stream selector, e.g. {job="nginx"}. */ export interface LabelMatcher { label: string; operator: string; value: string; } export interface LokiEditorProps { className?: string; maxHeight?: number | string; fontSize?: number; size?: 'small' | 'middle' | 'large'; theme?: 'light' | 'dark'; value?: string; placeholder?: string; enableAutocomplete?: boolean; readOnly?: boolean; disabled?: boolean; variables?: string[]; onChange?: (value: string) => void; onEnter?: (value: string) => void; onBlur?: (value: string) => void; onFocus?: (value: string) => void; editorDidMount?: (editor: monaco.editor.IStandaloneCodeEditor) => void; /** Async provider for label names used in stream selector completion. Receives current matchers for context. */ fetchLabelNames?: (currentMatchers: LabelMatcher[]) => Promise; /** Async provider for label values used in stream selector completion. Receives current matchers for context. */ fetchLabelValues?: (labelName: string, currentMatchers: LabelMatcher[]) => Promise; } export interface LokiCompletionContext { prefix: string; }