import type { DQLEditorValidityInfo } from './dql-editor-types.js'; import type { WithChildren } from '../../core/types/with-children.js'; import { type SharedBaseCodeEditorProps } from '../base-code-editor/BaseCodeEditor.js'; /** * Props for the `DQLEditor` component. * @public */ export interface DQLEditorBaseProps extends SharedBaseCodeEditorProps, WithChildren { /** * 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; } /** * Props for the `DQLEditor` in controlled usage. * @public */ export type DQLEditorControlledProps = { /** * The contents of the editor in controlled mode. * @defaultValue '' */ value?: string; /** Not allowed in controlled mode. */ defaultValue?: never; }; /** * Props for the `DQLEditor` in uncontrolled usage. * @public */ export type DQLEditorUncontrolledProps = { /** Not allowed in uncontrolled mode. */ value?: never; /** The initial contents of the editor for uncontrolled usage. */ defaultValue?: string; /** * `isControlled` has no effect without `value`. * @deprecated [APPDEV-17404] BREAKING-CHANGE: Will be removed when controlled behaviour becomes the default. */ isControlled?: never; }; /** * Props for the `DQLEditor` component. * @public */ export type DQLEditorProps = DQLEditorBaseProps & (DQLEditorControlledProps | DQLEditorUncontrolledProps); /** * Ref handle exposed by the `DQLEditor` component. * @public */ export type DQLEditorRef = { /** * Moves focus to the editor. */ focus: () => void; /** * Selects the text within the given character-offset range. */ selectRange: (range: { from: number; to: number; }) => void; /** * The underlying editor container DOM element. */ readonly element: HTMLDivElement | null; /** * Moves the cursor to the given character offset, or to the end of the document when `'end'` is passed. */ 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 (DQL). * 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) => import("react").ReactElement | null) & { ActionsMenu: (props: WithChildren) => null; };