import React, { Context } from 'react'; import { Value } from 'slate'; import { QueryFieldProps, QueryFieldState } from './types'; import './styles/queryField.css'; /** * Renders an editor field. * Pass initial value as initialQuery and listen to changes in props.onValueChanged. * This component can only process strings. Internally it uses Slate Value. * Implement props.onTypeahead to use suggestions, see PromQueryField.tsx as an example. */ export declare class QueryField extends React.PureComponent { plugins: any[]; runOnChangeDebounced: Function; lastExecutedValue: Value | null; mounted: boolean; editor: any | null; constructor(props: QueryFieldProps, context: Context); componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: QueryFieldProps, prevState: QueryFieldState): void; /** * Update local state, propagate change upstream and optionally run the query afterwards. */ onChange: (value: Value, runQuery?: boolean) => void; runOnChange: () => void; runOnRunQuery: () => void; runOnChangeAndRunQuery: () => void; /** * We need to handle blur events here mainly because of dashboard panels which expect to have query executed on blur. */ handleBlur: (event: Event, editor: any, next: Function) => any; render(): JSX.Element; }