import { type AriaLabelingProps, type DataTestId, type MaskingProps, type StylingProps } from '@dynatrace/strato-components/core'; import type { FormControlStateProps } from '../../core/types/form-control-state.js'; /** * @public */ export interface DQLEditorProps extends FormControlStateProps, AriaLabelingProps, StylingProps, DataTestId, MaskingProps { /** The ID for the DOM element. */ id?: string; /** * Test id used for matching the editor container. * @defaultValue 'dql-editor' */ 'data-testid'?: string; /** The value (i.e. contents) of the editor. * @defaultValue '' */ value?: string; /** Handler that is called when the value changes. */ onChange?: (value: string) => void; /** Displayed initially in the editor when there is no other content. */ placeholder?: string; /** Whether spellcheck should be enabled. * @defaultValue false */ spellCheck?: boolean; /** * If set to true, the DQL editor uses the full height available in its parent. * @defaultValue false */ fullHeight?: boolean; /** The start indices (character position) that should be folded initially in uncontrolled scenarios. */ defaultFolding?: number[]; /** The start indices (character position) that should be folded initially in controlled scenarios.*/ folding?: number[]; /** Callback that is called when folding changes. */ onFoldingChange?: (values: number[]) => void; /** Whether the input is readonly * @defaultValue false */ readOnly?: boolean; /** Whether long lines should be wrapped. * @defaultValue false */ lineWrap?: boolean; /** Callback that is called when the editor loses focus. */ onBlur?: (e: FocusEvent) => void; /** Callback that is called when the editor receives focus. */ onFocus?: (e: FocusEvent) => void; /** * Callback fired when DQL validation starts. * This can be used for setting a status that validation is in progress. */ onValidationStart?: () => void; /** * Callback fired when DQL validation ends. * This can be used for resetting a status that validation is in progress and to get the validation result. */ onValidationEnd?: (validityInfo: DQLEditorValidityInfo[]) => void; /** * Callback fired when new diagnostic information is available. * This can be used to get the validation result from outside the editor. */ onValidityChange?: (validityInfo: DQLEditorValidityInfo[]) => void; /** * Editor layout size, 'default' for standard spacing and 'condensed' for reduced font-size, padding and margins. * @defaultValue 'default' */ size?: 'default' | 'condensed'; /** * If set to true, `aria-required` will be set to true on the input element. * @defaultValue false */ required?: boolean; } /** * Represents one piece of diagnostics for the current DQL in the DQL editor. * @public */ export interface DQLEditorValidityInfo { /** Represents how serious the problem is. */ severity: 'error' | 'warning' | 'info'; /** Describes the problem. */ message: string; /** Start position in the editor. */ from: number; /** End position in the editor. */ to: number; } /** * public ref type * @public */ export type DQLEditorRef = { focus: () => void; selectRange: (range: { from: number; to: number; }) => void; readonly element: HTMLDivElement | null; setCursorPosition: (position: number | 'end') => void; }; /** * The `DQLEditor` is specifically designed for editing DQL queries. It further offers * syntax highlighting and autocomplete functionality specific to the Dynatrace Query Language. * Once the editor is focused via the keyboard, the user must press "Enter" to start editing and "Escape" to quit editing and return to the keyboard navigation flow. * @public */ export declare const DQLEditor: (props: DQLEditorProps & import("react").RefAttributes) => React.ReactElement | null;